note 32968 added to function.set-magic-quotes-runtime

From: Date: Thu, 12 Jun 2003 10:23:45 +0000
Subject: note 32968 added to function.set-magic-quotes-runtime
Groups: php.notes 
Request: Send a blank email to php-notes+get-50222@lists.php.net to get a copy of this message
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 ---- Manual Page -- http://www.php.net/manual/en/function.set-magic-quotes-runtime.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+32968 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+32968&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+32968&report=yes

« previous php.notes (#50222) next »