note 41675 added to function.get-magic-quotes-gpc
| From: | tsunanet dot HATES dot SPAM at rn2 dot php dot net | Date: | Mon, 19 Apr 2004 12:25:06 +0000 |
| Subject: | note 41675 added to function.get-magic-quotes-gpc | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-68326@lists.php.net to get a copy of this message | ||
Although many developers already said how ill was this feature so-called
"magic_quotes_gpc", I'd like to insist: dealing with this issue is a pain in the ass
and hopefully this useless feature will be removed from PHP.
Anyway, here's yet another way of getting rid of the pointless work done by magic_quotes_gpc,
so that you can let your script go exactly like if magic_quotes_gpc was set to off.
<?php
function magicQuotesRemove(&$array) {
if(!get_magic_quotes_gpc())
return;
foreach($array as $key => $elem) {
if(is_array($elem))
magicQuotesRemove($elem);
else
$array[$key] = stripslashes($elem);
}
}
magicQuotesRemove($_GET);
magicQuotesRemove($_POST);
magicQuotesRemove($_COOKIE);
?>
----
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+41675
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41675&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41675&report=yes
Search -- http://master.php.net/manage/user-notes.php