diff -r 5a6b6e770365 -r 68c69c656a2c web/lib/Zend/Serializer/Adapter/Json.php --- a/web/lib/Zend/Serializer/Adapter/Json.php Thu May 07 15:10:09 2015 +0200 +++ b/web/lib/Zend/Serializer/Adapter/Json.php Thu May 07 15:16:02 2015 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Serializer * @subpackage Adapter - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Json.php 24593 2012-01-05 20:35:02Z matthew $ + * @version $Id$ */ /** @see Zend_Serializer_Adapter_AdapterAbstract */ @@ -30,7 +30,7 @@ * @category Zend * @package Zend_Serializer * @subpackage Adapter - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Serializer_Adapter_Json extends Zend_Serializer_Adapter_AdapterAbstract @@ -77,17 +77,14 @@ try { $ret = Zend_Json::decode($json, $opts['objectDecodeType']); + } catch (Zend_Json_Exception $e) { + require_once 'Zend/Serializer/Exception.php'; + throw new Zend_Serializer_Exception('Invalid json data'); } catch (Exception $e) { require_once 'Zend/Serializer/Exception.php'; throw new Zend_Serializer_Exception('Unserialization failed by previous error', 0, $e); } - // json_decode returns null for invalid JSON - if ($ret === null && $json !== 'null') { - require_once 'Zend/Serializer/Exception.php'; - throw new Zend_Serializer_Exception('Invalid json data'); - } - return $ret; } }