note 20711 deleted from function.get-magic-quotes-gpc by tularis
| From: | tularis@php.net | Date: | Fri, 07 Feb 2003 19:57:47 +0000 |
| Subject: | note 20711 deleted from function.get-magic-quotes-gpc by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-43585@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);
}