Re-encode query values after passed to add_query_arg(). Props mdawaffe. fixes #4084

git-svn-id: http://svn.automattic.com/wordpress/trunk@5193 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rob1n 2007-04-06 04:21:21 +00:00
parent b557846efd
commit a7d8f6aa74
1 changed files with 3 additions and 1 deletions

View File

@ -815,6 +815,7 @@ function add_query_arg() {
foreach($qs as $k => $v) {
if ( $v !== FALSE ) {
$v = rawurlencode($v);
if ( $ret != '' )
$ret .= '&';
if ( empty($v) && !preg_match('|[?&]' . preg_quote($k, '|') . '=|', $query) )
@ -823,10 +824,11 @@ function add_query_arg() {
$ret .= "$k=$v";
}
}
$ret = trim($ret, '?');
$ret = $protocol . $base . $ret . $frag;
if ( get_magic_quotes_gpc() )
$ret = stripslashes($ret); // parse_str() adds slashes if magicquotes is on. See: http://php.net/parse_str
return trim($ret, '?');
return $ret;
}
/*