mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fixed case part of bug #64874 ("json_decode handles whitespace and case-sensitivity incorrectly")
This commit is contained in:
parent
1205a6c7dc
commit
91779db95b
4 changed files with 84 additions and 3 deletions
|
@ -712,14 +712,14 @@ PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len,
|
|||
|
||||
RETVAL_NULL();
|
||||
if (trim_len == 4) {
|
||||
if (!strncasecmp(trim, "null", trim_len)) {
|
||||
if (!strncmp(trim, "null", trim_len)) {
|
||||
/* We need to explicitly clear the error because its an actual NULL and not an error */
|
||||
jp->error_code = PHP_JSON_ERROR_NONE;
|
||||
RETVAL_NULL();
|
||||
} else if (!strncasecmp(trim, "true", trim_len)) {
|
||||
} else if (!strncmp(trim, "true", trim_len)) {
|
||||
RETVAL_BOOL(1);
|
||||
}
|
||||
} else if (trim_len == 5 && !strncasecmp(trim, "false", trim_len)) {
|
||||
} else if (trim_len == 5 && !strncmp(trim, "false", trim_len)) {
|
||||
RETVAL_BOOL(0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue