Skip to content

Commit

Permalink
merged PR zendframework/zf1#680 to fix "Zend_Json::decode null or emp…
Browse files Browse the repository at this point in the history
…ty string throw Zend_Json_Exception on PHP7"
  • Loading branch information
falkenhawk committed Sep 14, 2017
1 parent f1da5cc commit 674d8e9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/Zend/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ class Zend_Json
*/
public static function decode($encodedValue, $objectDecodeType = Zend_Json::TYPE_ARRAY)
{
if (in_array($encodedValue, array(null, ''))) {
return null;
}
$encodedValue = (string) $encodedValue;
if (function_exists('json_decode') && self::$useBuiltinEncoderDecoder !== true) {
$decode = json_decode($encodedValue, $objectDecodeType);
Expand Down

0 comments on commit 674d8e9

Please sign in to comment.