? ext/json/tests/bug38680.phpt Index: ext/json/json.c =================================================================== RCS file: /repository/php-src/ext/json/json.c,v retrieving revision 1.9.2.24 diff -u -r1.9.2.24 json.c --- ext/json/json.c 2 Oct 2008 03:41:24 -0000 1.9.2.24 +++ ext/json/json.c 3 Dec 2008 21:02:35 -0000 @@ -455,6 +455,7 @@ } else { + /* The JSON parser failed, let's try to parse some common PHP types */ double d; int type; long p; @@ -479,14 +480,9 @@ RETURN_DOUBLE(d); } } - if (parameter_len > 1 && *parameter == '"' && parameter[parameter_len-1] == '"') { - RETURN_STRINGL(parameter+1, parameter_len-2, 1); - } else if (*parameter == '{' || *parameter == '[') { /* invalid JSON string */ - RETURN_NULL(); - } else { - RETURN_STRINGL(parameter, parameter_len, 1); - } - } + /* Parsing failed, let's return NULL */ + RETURN_NULL(); + } } /* }}} */ Index: ext/json/tests/001.phpt =================================================================== RCS file: /repository/php-src/ext/json/tests/001.phpt,v retrieving revision 1.1.2.4 diff -u -r1.1.2.4 001.phpt --- ext/json/tests/001.phpt 3 Nov 2006 13:16:33 -0000 1.1.2.4 +++ ext/json/tests/001.phpt 3 Dec 2008 21:02:35 -0000 @@ -31,12 +31,12 @@ NULL NULL NULL -string(1) "." -string(1) "." -string(3) "" -string(1) ";" -string(12) "руссиш" -string(4) "blah" +NULL +NULL +NULL +NULL +NULL +NULL NULL object(stdClass)#1 (1) { ["test"]=> Index: ext/json/tests/bug41567.phpt =================================================================== RCS file: /repository/php-src/ext/json/tests/bug41567.phpt,v retrieving revision 1.1.2.6 diff -u -r1.1.2.6 bug41567.phpt --- ext/json/tests/bug41567.phpt 19 Nov 2008 17:00:13 -0000 1.1.2.6 +++ ext/json/tests/bug41567.phpt 3 Dec 2008 21:02:35 -0000 @@ -12,8 +12,6 @@ echo "Done\n"; ?> ---INI-- -precision=14 --EXPECT-- float(123456789.12345) Done Index: ext/json/tests/bug42090.phpt =================================================================== RCS file: /repository/php-src/ext/json/tests/bug42090.phpt,v retrieving revision 1.1.2.2 diff -u -r1.1.2.2 bug42090.phpt --- ext/json/tests/bug42090.phpt 24 Jul 2007 22:57:13 -0000 1.1.2.2 +++ ext/json/tests/bug42090.phpt 3 Dec 2008 21:02:35 -0000 @@ -1,5 +1,5 @@ --TEST-- -Bug#42090 (json_decode causes segmentation fault) +Bug #42090 (json_decode causes segmentation fault) --SKIPIF-- --FILE-- @@ -16,10 +16,9 @@ ?> --EXPECT-- string(0) "" -string(5) "".."." -string(1) """ -string(2) """" +NULL +NULL +NULL string(4) ""\""" string(1) """ string(2) """" -