Actually, we always need to URLencode square brackets... or wp_redirect() will strip them out. see #4935. see #4878
git-svn-id: http://svn.automattic.com/wordpress/trunk@6070 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
51299852ef
commit
ba6e8f4a92
|
@ -107,20 +107,14 @@ if (!function_exists('http_build_query')) {
|
||||||
// from php.net (modified by Mark Jaquith to behave like the native PHP5 function)
|
// from php.net (modified by Mark Jaquith to behave like the native PHP5 function)
|
||||||
function _http_build_query($data, $prefix=null, $sep=null, $key='', $urlencode=true) {
|
function _http_build_query($data, $prefix=null, $sep=null, $key='', $urlencode=true) {
|
||||||
$ret = array();
|
$ret = array();
|
||||||
if ( $urlencode ) {
|
|
||||||
$lsb = '%5B';
|
|
||||||
$rsb = '%5D';
|
|
||||||
} else {
|
|
||||||
$lsb = '[';
|
|
||||||
$rsb = ']';
|
|
||||||
}
|
|
||||||
foreach ( (array) $data as $k => $v ) {
|
foreach ( (array) $data as $k => $v ) {
|
||||||
if ( $urlencode)
|
if ( $urlencode)
|
||||||
$k = urlencode($k);
|
$k = urlencode($k);
|
||||||
if ( is_int($k) && $prefix != null )
|
if ( is_int($k) && $prefix != null )
|
||||||
$k = $prefix.$k;
|
$k = $prefix.$k;
|
||||||
if ( !empty($key) )
|
if ( !empty($key) )
|
||||||
$k = $key . $lsb . $k . $rsb;
|
$k = $key . '%5B' . $k . '%5D';
|
||||||
if ( $v === NULL )
|
if ( $v === NULL )
|
||||||
continue;
|
continue;
|
||||||
elseif ( $v === FALSE )
|
elseif ( $v === FALSE )
|
||||||
|
|
Loading…
Reference in New Issue