Created
July 10, 2011 15:58
-
-
Save BastienClement/1074644 to your computer and use it in GitHub Desktop.
Magic Quote Killer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Turn off magic_quotes_runtime | |
if (get_magic_quotes_runtime()) | |
@ini_set('magic_quotes_runtime', false); | |
// 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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment