diff options
-rw-r--r-- | ext/json/json.c | 8 | ||||
-rw-r--r-- | ext/json/tests/001.phpt | 12 | ||||
-rw-r--r-- | ext/json/tests/bug42090.phpt | 7 |
3 files changed, 10 insertions, 17 deletions
diff --git a/ext/json/json.c b/ext/json/json.c index b52b3ff5f3..24afcdf560 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -523,13 +523,7 @@ static PHP_FUNCTION(json_decode) RETURN_DOUBLE(d); } } - if (str_len > 1 && *str == '"' && str[str_len-1] == '"') { - RETURN_STRINGL(str+1, str_len-2, 1); - } else if (*str == '{' || *str == '[') { /* invalid JSON string */ - RETURN_NULL(); - } else { - RETURN_STRINGL(str, str_len, 1); - } + RETURN_NULL(); } } /* }}} */ diff --git a/ext/json/tests/001.phpt b/ext/json/tests/001.phpt index 4c9f918b48..095aedf631 100644 --- a/ext/json/tests/001.phpt +++ b/ext/json/tests/001.phpt @@ -31,12 +31,12 @@ NULL 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"]=> diff --git a/ext/json/tests/bug42090.phpt b/ext/json/tests/bug42090.phpt index daa57c3474..9e5b3317e5 100644 --- a/ext/json/tests/bug42090.phpt +++ b/ext/json/tests/bug42090.phpt @@ -16,10 +16,9 @@ var_dump( ?> --EXPECT-- string(0) "" -string(5) "".."." -string(1) """ -string(2) """" +NULL +NULL +NULL string(4) ""\""" string(1) """ string(2) """" - |