ZF-8918: missing thrown exception on decode invalid json
Description
Zend_Json::decode doesn't throw an exception on failure.
Additionally the return value of json_decode has changed on invalid data within ZF supported php versions:
var_dump(json_decode('invalid json'));
// -> NULL
var_dump(json_decode('invalid json'));
// -> string(16) "invalid json"
Comments
Posted by Marc Bennewitz (private) (mabe) on 2010-01-24T12:05:35.000+0000
Added a patch for build-in json_decode for php 5.2 & 5.3
Posted by Marc Bennewitz (private) (mabe) on 2010-01-24T16:24:52.000+0000
Is there a chance that this could solve with 1.10 because in base of this bug Zend_Serializer_Adapter_JsonTest::testUnserialzeInvalid fails on php < 5.3
Posted by Matthew Weier O'Phinney (matthew) on 2010-01-25T11:56:25.000+0000
Patch applied (with additional unit test) to trunk and 1.10 release branch.