]> granicus.if.org Git - php/commitdiff
Test for #52359
authorKai Schroeder <k.schroeder@php.net>
Sat, 17 Jul 2010 21:26:01 +0000 (21:26 +0000)
committerKai Schroeder <k.schroeder@php.net>
Sat, 17 Jul 2010 21:26:01 +0000 (21:26 +0000)
ext/standard/tests/http/bug52359.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/http/bug52359.phpt b/ext/standard/tests/http/bug52359.phpt
new file mode 100644 (file)
index 0000000..a2d93d2
--- /dev/null
@@ -0,0 +1,21 @@
+--TEST--
+Bug #52359 (http_build_query seem to encode array incorrectly)
+--FILE--
+<?php
+$a = array(
+    'foo/bar' => array(
+        '1',
+        '2'
+    ),
+    'bar' => 'foo'
+);
+
+$b = http_build_query($a, NULL, '&');
+var_dump($b);
+
+$c = urldecode($b);
+var_dump($c);
+?>
+--EXPECTF--
+string(43) "foo%2Fbar%5B%5D=1&foo%2Fbar%5B%5D=2&bar=foo"
+string(31) "foo/bar[]=1&foo/bar[]=2&bar=foo"
\ No newline at end of file