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:
markjaquith 2007-09-10 15:53:34 +00:00
parent 51299852ef
commit ba6e8f4a92

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 )