Skip to content

Commit e8c6d28

Browse files
committed
http_build_query: adjust to current browser (and apparently Node) behavior of first iterating numeric indexes regardless of placement within the literal)
1 parent 5f4b6b7 commit e8c6d28

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

functions/url/http_build_query.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ function http_build_query(formdata, numeric_prefix, arg_separator) {
99
// + input by: Dreamer
1010
// + bugfixed by: Brett Zamir (http://brett-zamir.me)
1111
// + bugfixed by: MIO_KODUKI (http://mio-koduki.blogspot.com/)
12-
// % note 1: If the value is null, key and value is skipped in http_build_query of PHP. But, phpjs is not.
12+
// % note 1: If the value is null, key and value are skipped in the http_build_query of PHP while in phpjs they are not.
1313
// - depends on: urlencode
1414
// * example 1: http_build_query({foo: 'bar', php: 'hypertext processor', baz: 'boom', cow: 'milk'}, '', '&');
1515
// * returns 1: 'foo=bar&php=hypertext+processor&baz=boom&cow=milk'
1616
// * example 2: http_build_query({'php': 'hypertext processor', 0: 'foo', 1: 'bar', 2: 'baz', 3: 'boom', 'cow': 'milk'}, 'myvar_');
17-
// * returns 2: 'php=hypertext+processor&myvar_0=foo&myvar_1=bar&myvar_2=baz&myvar_3=boom&cow=milk'
17+
// * returns 2: 'myvar_0=foo&myvar_1=bar&myvar_2=baz&myvar_3=boom&php=hypertext+processor&cow=milk'
1818
var value, key, tmp = [],
1919
that = this;
2020

0 commit comments

Comments
 (0)