note 41675 deleted from function.get-magic-quotes-gpc by aidan
| From: | aidan@php.net | Date: | Tue, 06 Jul 2004 06:19:24 +0000 |
| Subject: | note 41675 deleted from function.get-magic-quotes-gpc by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-72688@lists.php.net to get a copy of this message | ||
Note Submitter: tsunanet.HATES.SPAM [AT] nerim [DOT] n3t
----
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);
?>