Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ PHP NEWS
. Fixed stack overflow in filter_var() and filter_var_array() with deeply
nested arrays. (Eyüp Can Akman)

- JSON:
. Fixed json_decode() and json_validate() error messages. (lacatoire)

- MBString:
. Fixed stack overflow in mb_check_encoding() and mb_convert_encoding() with
deeply nested arrays. (Eyüp Can Akman)
Expand Down
4 changes: 2 additions & 2 deletions ext/json/json.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ PHP_FUNCTION(json_decode)
}

if (depth > INT_MAX) {
zend_argument_value_error(3, "must be less than %d", INT_MAX);
zend_argument_value_error(3, "must be less than or equal to %d", INT_MAX);
RETURN_THROWS();
}

Expand Down Expand Up @@ -347,7 +347,7 @@ PHP_FUNCTION(json_validate)
}

if (depth > INT_MAX) {
zend_argument_value_error(2, "must be less than %d", INT_MAX);
zend_argument_value_error(2, "must be less than or equal to %d", INT_MAX);
RETURN_THROWS();
}

Expand Down
2 changes: 1 addition & 1 deletion ext/json/tests/bug72787.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ try {

?>
--EXPECTF--
json_decode(): Argument #3 ($depth) must be less than %d
json_decode(): Argument #3 ($depth) must be less than or equal to %d
2 changes: 1 addition & 1 deletion ext/json/tests/json_validate_003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ try {

?>
--EXPECTF--
json_validate(): Argument #2 ($depth) must be less than %d
json_validate(): Argument #2 ($depth) must be less than or equal to %d
int(0)
string(8) "No error"
Loading