

if (get_magic_quotes_gpc()) {
function stripslashes_deep($value) {
$char_array = array();
$value = is_array($value) ? array_map('stripslashes_deep', $value) : strtr(stripslashes($value), $char_array);
return $value;
}
$_POST = array_map('stripslashes_deep', $_POST);
$_GET = array_map('stripslashes_deep', $_GET);
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
}
function unmagic_quotes()
{
for($i = 0; $i < func_num_args(); $i++)
{
$temp = func_get_arg($i);
if(is_array($temp))
{
foreach($temp as $key => $val)
{
if(is_array($GLOBALS[$key]))
{
_unmagic_quotes($GLOBALS[$key]);
}
}
}
else
{
stripslashes($GLOBALS[$key]);
}
}
}
if(get_magic_quotes_gpc())
{
unmagic_quotes($_GET $_POST, $_REQUEST, $_COOKIE);
}
if(get_magic_quotes_runtime())
{
set_magic_quotes_runtime(0);
}


