add stripslashes for a second level for arrays

This commit is contained in:
Lars Kneschke 2004-01-20 05:28:04 +00:00
parent ca4af9837c
commit 0364332b5c

View File

@ -512,12 +512,25 @@
}
if(get_magic_quotes_gpc() && isset($value))
{
// we need to stripslash 2 levels of arrays
// because of the password function in preferences
// it's named ['user']['variablename']['pw']
if(@is_array($value))
{
/* stripslashes on the first level of array values */
foreach($value as $name => $val)
{
$value[$name] = stripslashes($val);
if(@is_array($val))
{
foreach($val as $name2 => $val2)
{
$value[$name][$name2] = stripslashes($val2);
}
}
else
{
$value[$name] = stripslashes($val);
}
}
}
else