mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix GH-18400: http_build_query type error is inaccurate
Objects are also accepted still, so the error message is misleading. Closes GH-18434.
This commit is contained in:
1
NEWS
1
NEWS
@@ -13,6 +13,7 @@ PHP NEWS
|
||||
|
||||
- Standard:
|
||||
. Fixed bug GH-17403 (Potential deadlock when putenv fails). (nielsdos)
|
||||
. Fixed bug GH-18400 (http_build_query type error is inaccurate). (nielsdos)
|
||||
|
||||
24 Apr 2025, PHP 8.4.7
|
||||
|
||||
|
||||
@@ -246,7 +246,7 @@ PHP_FUNCTION(http_build_query)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
|
||||
if (UNEXPECTED(Z_TYPE_P(formdata) == IS_OBJECT && (Z_OBJCE_P(formdata)->ce_flags & ZEND_ACC_ENUM))) {
|
||||
zend_argument_type_error(1, "must be of type array, %s given", zend_zval_value_name(formdata));
|
||||
zend_argument_type_error(1, "must not be an enum, %s given", zend_zval_value_name(formdata));
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
|
||||
@@ -33,4 +33,4 @@ try {
|
||||
--EXPECT--
|
||||
e1=hello+world%21&e2=42
|
||||
ValueError: Unbacked enum E3 cannot be converted to a string
|
||||
TypeError: http_build_query(): Argument #1 ($data) must be of type array, E1 given
|
||||
TypeError: http_build_query(): Argument #1 ($data) must not be an enum, E1 given
|
||||
|
||||
Reference in New Issue
Block a user