Closed jhorbulyk closed 7 years ago
Consider the following PHP code:
$params = [ 'foo' => [ [ 'bar' => 'baz', 'operator' => '>' ] ] ]; print(http_build_query($params));
The output is: foo%5B0%5D%5Bbar%5D=baz&foo%5B0%5D%5Boperator%5D=%3E which decodes to foo[0][bar]=baz&foo[0][operator]=>
foo%5B0%5D%5Bbar%5D=baz&foo%5B0%5D%5Boperator%5D=%3E
foo[0][bar]=baz&foo[0][operator]=>
Consider the following JS code:
var http_build_query = require('phplike/module.js').http_build_query; var params = { foo: [ {bar:'baz', operator: '>'} ] }; console.log(http_build_query(params));
The result is foo[0][bar]=baz&foo[0][operator]=%3E which matches neither the pre or post encoded values for the php function.
foo[0][bar]=baz&foo[0][operator]=%3E
Is this a bug which should be fixed?
New version phplike@2.5.5
Consider the following PHP code:
The output is:
foo%5B0%5D%5Bbar%5D=baz&foo%5B0%5D%5Boperator%5D=%3E
which decodes tofoo[0][bar]=baz&foo[0][operator]=>
Consider the following JS code:
The result is
foo[0][bar]=baz&foo[0][operator]=%3E
which matches neither the pre or post encoded values for the php function.Is this a bug which should be fixed?