mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-7.0' into PHP-7.1
This commit is contained in:
commit
37c12f8f86
2 changed files with 25 additions and 0 deletions
|
@ -258,6 +258,16 @@ static PHP_FUNCTION(json_decode)
|
|||
RETURN_NULL();
|
||||
}
|
||||
|
||||
if (depth <= 0) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Depth must be greater than zero");
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
if (depth > INT_MAX) {
|
||||
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Depth must be lower than %d", INT_MAX);
|
||||
RETURN_NULL();
|
||||
}
|
||||
|
||||
/* For BC reasons, the bool $assoc overrides the long $options bit for PHP_JSON_OBJECT_AS_ARRAY */
|
||||
if (assoc) {
|
||||
options |= PHP_JSON_OBJECT_AS_ARRAY;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue