From: Craig Andrews Date: Tue, 9 Mar 2010 02:42:17 +0000 (-0500) Subject: make common_copy_args() work when the post/get request includes arrays (form elements... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=689e2e112bbd84ab05549b83bf99be1d8c1a39e9;p=quix0rs-gnu-social.git make common_copy_args() work when the post/get request includes arrays (form elements with names ending in [] having multiple values) --- diff --git a/lib/util.php b/lib/util.php index da2799d4f9..c5dacb6996 100644 --- a/lib/util.php +++ b/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; }