Actually, we always need to URLencode square brackets... or wp_redirect() will strip them out. see #4935. see #4878

git-svn-id: https://develop.svn.wordpress.org/trunk@6070 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2007-09-10 15:53:34 +00:00
parent f88ae978d1
commit 605d95b344
1 changed files with 2 additions and 8 deletions

View File

@ -107,20 +107,14 @@ if (!function_exists('http_build_query')) {
// 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) {
$ret = array();
if ( $urlencode ) {
$lsb = '%5B';
$rsb = '%5D';
} else {
$lsb = '[';
$rsb = ']';
}
foreach ( (array) $data as $k => $v ) {
if ( $urlencode)
$k = urlencode($k);
if ( is_int($k) && $prefix != null )
$k = $prefix.$k;
if ( !empty($key) )
$k = $key . $lsb . $k . $rsb;
$k = $key . '%5B' . $k . '%5D';
if ( $v === NULL )
continue;
elseif ( $v === FALSE )