diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-11-27 11:22:36 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2011-11-27 11:22:36 -0500 |
commit | 3d6790614bb0dc776e02a95835e5c274263d1d1a (patch) | |
tree | aad032777fccb7fbdc80551a6f89f4bb4845a510 /shell/no_magicquotes.php | |
parent | 66c84cedfb411ad6ca0508d9f45d6d33c8ad474d (diff) |
This zip file was identified as ltshell-3.zip
Diffstat (limited to 'shell/no_magicquotes.php')
-rw-r--r-- | shell/no_magicquotes.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/shell/no_magicquotes.php b/shell/no_magicquotes.php new file mode 100644 index 0000000..f6718eb --- /dev/null +++ b/shell/no_magicquotes.php @@ -0,0 +1,26 @@ +<?php +/* This was contributed by an awesome anonymous user in the comments section of + * the PHP manual on 17-Dec-2006 08:20 + */ +if (get_magic_quotes_gpc()) { + function undoMagicQuotes($array, $topLevel=true) { + $newArray = array(); + foreach($array as $key => $value) { + if (!$topLevel) { + $key = stripslashes($key); + } + if (is_array($value)) { + $newArray[$key] = undoMagicQuotes($value, false); + } + else { + $newArray[$key] = stripslashes($value); + } + } + return $newArray; + } + $_GET = undoMagicQuotes($_GET); + $_POST = undoMagicQuotes($_POST); + $_COOKIE = undoMagicQuotes($_COOKIE); + $_REQUEST = undoMagicQuotes($_REQUEST); +} +?> |