note 56254 added to function.get-magic-quotes-gpc
| From: | Balu at osu1 dot php dot net | Date: | Sun, 28 Aug 2005 20:42:06 +0000 |
| Subject: | note 56254 added to function.get-magic-quotes-gpc | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94311@lists.php.net to get a copy of this message | ||
Just for reference - I like the following code to clean up the superglobals. It was posted here by
"php Pest" sometime...
if ((bool) get_magic_quotes_GPC()) { // by "php Pest"
// Really EGPCSR - Environment $_ENV, GET $_GET , POST $_POST, Cookie $_COOKIE, Server $_SERVER
// and their HTTP_*_VARS cousins (separate arrays, not references) and $_REQUEST
$fnStripMagicQuotes = create_function(
'&$mData, $fnSelf',
'if (is_array($mData)) { foreach ($mData as $mKey=>$mValue) $fnSelf($mData[$mKey],
$fnSelf); return; } '.
'$mData = stripslashes($mData);'
);
$fnStripMagicQuotes($_POST, $fnStripMagicQuotes); // do each set of EGPCSR as you find necessary
$fnStripMagicQuotes($_GET, $fnStripMagicQuotes);
$fnStripMagicQuotes($_REQUEST, $fnStripMagicQuotes);
}
----
Manual Page -- http://www.php.net/manual/en/function.get-magic-quotes-gpc.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56254
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56254&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56254&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56254&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56254&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56254&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56254&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56254&report=yes
Search -- http://master.php.net/manage/user-notes.php