Created
February 27, 2011 15:55
-
-
Save emad-elsaid/846278 to your computer and use it in GitHub Desktop.
that correct GET and POST COOKIE and REQUEST for servers with magic quotes ON option
This file contains hidden or 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 | |
| if (get_magic_quotes_gpc()) { | |
| $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST); | |
| while (list($key, $val) = each($process)) { | |
| foreach ($val as $k => $v) { | |
| unset($process[$key][$k]); | |
| if (is_array($v)) { | |
| $process[$key][stripslashes($k)] = $v; | |
| $process[] = &$process[$key][stripslashes($k)]; | |
| } else { | |
| $process[$key][stripslashes($k)] = stripslashes($v); | |
| } | |
| } | |
| } | |
| unset($process); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment