stripslashes on the first level of a posted array, per discussion with lars

This commit is contained in:
Miles Lott 2004-01-10 15:04:17 +00:00
parent 4137e48c3e
commit e0e5763821

View File

@ -510,9 +510,21 @@
$value = $GLOBALS[$meth][$varname]; $value = $GLOBALS[$meth][$varname];
$i = $cnt+1; $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; break;
case 'FILES': case 'FILES':