Magic quotes and stripslashes solution

By.

min read

My profile

Share this:

How to get rid of magic quotes “harm” ?

Test if they are “on” and do something about it !

[code:1:db33d19b58]if (get_magic_quotes_gpc()) {
function stripslashes_deep($value)
{
$value = is_array($value) ? array_map(’stripslashes_deep’, $value) : stripslashes($value);
return $value;
}

$_POST = array_map(’stripslashes_deep’, $_POST);
$_GET = array_map(’stripslashes_deep’, $_GET);
$_COOKIE = array_map(’stripslashes_deep’, $_COOKIE);
$_REQUEST = array_map(’stripslashes_deep’, $_REQUEST);
}[/code:1:db33d19b58]

[b:db33d19b58]Read on:[/b:db33d19b58]
http://php.net/manual/en/function.stripslashes.php ( source )
http://www.tizag.com/phpT/php-magic-quotes.php
http://php.net/manual/en/security.magicquotes.disabling.php

Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *