note 32968 deleted from function.set-magic-quotes-runtime by didou

From: Date: Thu, 12 Jun 2003 15:00:22 +0000
Subject: note 32968 deleted from function.set-magic-quotes-runtime by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-50234@lists.php.net to get a copy of this message
Note Submitter: mark@boo-lah.com ---- it seems that gnarf at gnarf dot net's fantastic "defeat magic quotes" function has dissapeared, so im putting it back... // Defeat magic quotes if (get_magic_quotes_gpc()) { remove_magic_quotes("_GET"); remove_magic_quotes("_POST"); remove_magic_quotes("_SESSION"); remove_magic_quotes("_COOKIE"); ini_set("magic_quotes_gpc",0); } set_magic_quotes_runtime(0); 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;"); } } enjoy

« previous php.notes (#50234) next »