Skip to content

Commit e5b3e37

Browse files
committed
Merge branch 'PHP-8.3'
* PHP-8.3: ext/standard: Fix GH-9316
2 parents 7843ef7 + 37f67a9 commit e5b3e37

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

ext/standard/http.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ PHP_FUNCTION(http_build_query)
226226
Z_PARAM_ARRAY_OR_OBJECT(formdata)
227227
Z_PARAM_OPTIONAL
228228
Z_PARAM_STRING(prefix, prefix_len)
229-
Z_PARAM_STR(arg_sep)
229+
Z_PARAM_STR_OR_NULL(arg_sep)
230230
Z_PARAM_LONG(enc_type)
231231
ZEND_PARSE_PARAMETERS_END();
232232

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
Bug GH-9316 (http_build_query() default null argument for $arg_separator is implicitly coerced to string)
3+
--FILE--
4+
<?php
5+
6+
$data = [
7+
'hello' => 'world',
8+
'foo' => 'bar',
9+
];
10+
11+
var_dump(http_build_query(
12+
$data,
13+
encoding_type: PHP_QUERY_RFC3986
14+
));
15+
?>
16+
--EXPECT--
17+
string(19) "hello=world&foo=bar"

0 commit comments

Comments
 (0)