Skip to content

Commit 674d8e9

Browse files
committed
merged PR zendframework/zf1#680 to fix "Zend_Json::decode null or empty string throw Zend_Json_Exception on PHP7"
1 parent f1da5cc commit 674d8e9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

library/Zend/Json.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ class Zend_Json
7373
*/
7474
public static function decode($encodedValue, $objectDecodeType = Zend_Json::TYPE_ARRAY)
7575
{
76+
if (in_array($encodedValue, array(null, ''))) {
77+
return null;
78+
}
7679
$encodedValue = (string) $encodedValue;
7780
if (function_exists('json_decode') && self::$useBuiltinEncoderDecoder !== true) {
7881
$decode = json_decode($encodedValue, $objectDecodeType);

0 commit comments

Comments
 (0)