summaryrefslogtreecommitdiff
path: root/ext/json/json.c
diff options
context:
space:
mode:
authorScott MacVicar <scottmac@php.net>2008-12-12 23:19:47 +0000
committerScott MacVicar <scottmac@php.net>2008-12-12 23:19:47 +0000
commited5f04710b2535f7c1f620c0289f56d17a7dba33 (patch)
tree27323d16c61316108836c587d47587ba1e7cd54a /ext/json/json.c
parentdddbfccb9fa49d77d5dc556abdf667a016c73065 (diff)
downloadphp-git-ed5f04710b2535f7c1f620c0289f56d17a7dba33.tar.gz
MFH Fix bug #45989 - json_decode() doesn't return NULL on certain invalid strings
Diffstat (limited to 'ext/json/json.c')
-rw-r--r--ext/json/json.c8
1 files changed, 1 insertions, 7 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();
}
}
/* }}} */