make common_copy_args() work when the post/get request includes arrays (form elements with names ending in [] having multiple values)

This commit is contained in:
Craig Andrews 2010-03-08 21:42:17 -05:00
parent f8c5996758
commit 689e2e112b

View File

@ -1462,7 +1462,15 @@ function common_copy_args($from)
$to = array();
$strip = get_magic_quotes_gpc();
foreach ($from as $k => $v) {
$to[$k] = ($strip) ? stripslashes($v) : $v;
if($strip) {
if(is_array($v)) {
$to[$k] = common_copy_args($v);
} else {
$to[$k] = stripslashes($v);
}
} else {
$to[$k] = $v;
}
}
return $to;
}