mirror of
https://github.com/WordPress/WordPress.git
synced 2025-03-09 07:00:01 +00:00
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:
parent
b557846efd
commit
a7d8f6aa74
@ -815,6 +815,7 @@ function add_query_arg() {
|
|||||||
|
|
||||||
foreach($qs as $k => $v) {
|
foreach($qs as $k => $v) {
|
||||||
if ( $v !== FALSE ) {
|
if ( $v !== FALSE ) {
|
||||||
|
$v = rawurlencode($v);
|
||||||
if ( $ret != '' )
|
if ( $ret != '' )
|
||||||
$ret .= '&';
|
$ret .= '&';
|
||||||
if ( empty($v) && !preg_match('|[?&]' . preg_quote($k, '|') . '=|', $query) )
|
if ( empty($v) && !preg_match('|[?&]' . preg_quote($k, '|') . '=|', $query) )
|
||||||
@ -823,10 +824,11 @@ function add_query_arg() {
|
|||||||
$ret .= "$k=$v";
|
$ret .= "$k=$v";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$ret = trim($ret, '?');
|
||||||
$ret = $protocol . $base . $ret . $frag;
|
$ret = $protocol . $base . $ret . $frag;
|
||||||
if ( get_magic_quotes_gpc() )
|
if ( get_magic_quotes_gpc() )
|
||||||
$ret = stripslashes($ret); // parse_str() adds slashes if magicquotes is on. See: http://php.net/parse_str
|
$ret = stripslashes($ret); // parse_str() adds slashes if magicquotes is on. See: http://php.net/parse_str
|
||||||
return trim($ret, '?');
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user