From e0e57638214ae99811abad777be1205fe47be450 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Sat, 10 Jan 2004 15:04:17 +0000 Subject: [PATCH] stripslashes on the first level of a posted array, per discussion with lars --- phpgwapi/inc/common_functions.inc.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/common_functions.inc.php b/phpgwapi/inc/common_functions.inc.php index a172a64133..f749d1f2f7 100755 --- a/phpgwapi/inc/common_functions.inc.php +++ b/phpgwapi/inc/common_functions.inc.php @@ -510,9 +510,21 @@ $value = $GLOBALS[$meth][$varname]; $i = $cnt+1; } - if(get_magic_quotes_gpc() && !@is_array($value)) + if(get_magic_quotes_gpc()) { - $value = stripslashes($value); + if(@is_array($value)) + { + /* stripslashes on the first level of array values */ + foreach($value as $name => $val) + { + $value[$name] = stripslashes($val); + } + } + else + { + /* stripslashes on this (string) */ + $value = stripslashes($value); + } } break; case 'FILES':