note 19900 added to function.get-magic-quotes-gpc
| From: | akira at _funai dot com | Date: | Thu, 14 Mar 2002 16:15:46 +0000 |
| Subject: | note 19900 added to function.get-magic-quotes-gpc | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-27788@lists.php.net to get a copy of this message | ||
Here is my little code that recursively remove all the magic_quotes from $HTTP_*_VARS and parsed
variables...
remove_magic_quotes('HTTP_GET_VARS');
remove_magic_quotes('HTTP_POST_VARS');
remove_magic_quotes('HTTP_COOKIE_VARS');
function remove_magic_quotes($vars,$suffix = '') {
eval("\$vars_val =& \$GLOBALS[$vars]$suffix;");
if (is_array($vars_val)) {
reset($vars_val);
while (list($key,$val) = each($vars_val))
remove_magic_quotes($vars,$suffix."[$key]");
}
else {
$vars_val = stripslashes($vars_val);
eval("\$GLOBALS$suffix = \$vars_val;");
}
}
--
http://www.php.net/manual/en/function.get-magic-quotes-gpc.php
http://master.php.net/manage/user-notes.php?action=edit+19900
http://master.php.net/manage/user-notes.php?action=delete+19900
http://master.php.net/manage/user-notes.php?action=reject+19900