Topic: Undo magic_quotes_gpc
Right now you have this code to undo magic_quotes_gpc in include/common.php:
// Strip slashes from GET/POST/COOKIE (if magic_quotes_gpc is enabled)
if (get_magic_quotes_gpc())
{
function stripslashes_array($array)
{
return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array);
}
$_GET = stripslashes_array($_GET);
$_POST = stripslashes_array($_POST);
$_COOKIE = stripslashes_array($_COOKIE);
}This does not work with more-than-two-dimensional arrays in $_POST (probably neither in $_GET and $_COOKIE), like this:
<input name="frm[pages][2]" ... />This seems to have something to do with array_map(). Here is a quick fix:
if (get_magic_quotes_gpc())
{
function check_arr (&$arr)
{
foreach ($arr as $elem)
{
if (is_array($elem))
check_arr($elem);
else
$elem = stripslashes($elem); // $elem is a reference to the array element, right?
} // if not, just use $arr[$key] (add "$key =>" to the foreach loop)
return;
}
check_arr($_GET);
check_arr($_POST);
check_arr($_COOKIE);
}I haven't tested it yet, but I will do that tonight and post some test reports tomorrow.