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:
parent
f8c5996758
commit
689e2e112b
10
lib/util.php
10
lib/util.php
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user