note 19900 deleted from function.get-magic-quotes-gpc by didou

From: Date: Thu, 29 May 2003 21:12:32 +0000
Subject: note 19900 deleted from function.get-magic-quotes-gpc by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-49321@lists.php.net to get a copy of this message
Note Submitter: akira@_funai.com ---- 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;"); } }

« previous php.notes (#49321) next »