note 20711 added to function.get-magic-quotes-gpc

From: Date: Sat, 13 Apr 2002 11:41:15 +0000
Subject: note 20711 added to function.get-magic-quotes-gpc
Groups: php.notes 
Request: Send a blank email to php-notes+get-29190@lists.php.net to get a copy of this message
reply: hirose@tg.rim.or.jp 28-May-2001 Setting MagicQuotes off needs ini_set("magic_quotes_gpc",0); to be called, too, because even if it has no effect to anything done, you need it because otherwise other scripts you use dont know that magicquotes are off and may strip slashes again or may not add_slashes when useing sql or echoing javascript. So the real code would be: if (get_magic_quotes_gpc()) { // Overrides GPC variables for (reset($HTTP_GET_VARS); list($k, $v) = each($HTTP_GET_VARS); ) $$k = $HTTP_GET_VARS[$k] = stripslashes($v); for (reset($HTTP_POST_VARS); list($k, $v) = each($HTTP_POST_VARS); ) $$k = $HTTP_POST_VARS[$k] = stripslashes($v); for (reset($HTTP_COOKIE_VARS); list($k, $v) = each($HTTP_COOKIE_VARS); ) $$k = $HTTP_COOKIE_VARS[$k] = stripslashes($v); ini_set("magic_quotes_gpc",0); } -- http://www.php.net/manual/en/function.get-magic-quotes-gpc.php http://master.php.net/manage/user-notes.php?action=edit+20711 http://master.php.net/manage/user-notes.php?action=delete+20711 http://master.php.net/manage/user-notes.php?action=reject+20711

« previous php.notes (#29190) next »