Get add_query_arg() to urlencode all values of parse_str array. Props mdawaffe. fixes #4084

git-svn-id: http://svn.automattic.com/wordpress/trunk@5261 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
rob1n 2007-04-12 22:00:22 +00:00
parent 0e669f143d
commit 30d6c1ad15
2 changed files with 12 additions and 4 deletions

View File

@ -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;
}

View File

@ -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);