From 605d95b3442de7717f27f7380ab53ecb883600c0 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Mon, 10 Sep 2007 15:53:34 +0000 Subject: [PATCH] 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 --- wp-includes/compat.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/wp-includes/compat.php b/wp-includes/compat.php index 89bc6f4c20..0434446e53 100644 --- a/wp-includes/compat.php +++ b/wp-includes/compat.php @@ -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 )