Get add_query_arg() to urlencode all values of parse_str array. Props mdawaffe. fixes #4084
git-svn-id: https://develop.svn.wordpress.org/trunk@5261 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b88e6b40d8
commit
eac89c8fdd
@ -581,11 +581,18 @@ function addslashes_gpc($gpc) {
|
||||
}
|
||||
|
||||
|
||||
function stripslashes_deep($value)
|
||||
{
|
||||
function stripslashes_deep($value) {
|
||||
$value = is_array($value) ?
|
||||
array_map('stripslashes_deep', $value) :
|
||||
stripslashes($value);
|
||||
array_map('stripslashes_deep', $value) :
|
||||
stripslashes($value);
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
function urlencode_deep($value) {
|
||||
$value = is_array($value) ?
|
||||
array_map('urlencode_deep', $value) :
|
||||
urlencode($value);
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
@ -808,6 +808,7 @@ function add_query_arg() {
|
||||
parse_str($query, $qs);
|
||||
if ( get_magic_quotes_gpc() )
|
||||
$qs = stripslashes_deep($qs); // parse_str() adds slashes if magicquotes is on. See: http://php.net/parse_str
|
||||
$qs = urlencode_deep($qs);
|
||||
if ( is_array(func_get_arg(0)) ) {
|
||||
$kayvees = func_get_arg(0);
|
||||
$qs = array_merge($qs, $kayvees);
|
||||
|
Loading…
Reference in New Issue
Block a user