note 91653 added to security.magicquotes.disabling
| From: | metala at metala dot org | Date: | Sun, 21 Jun 2009 22:38:58 +0000 |
| Subject: | note 91653 added to security.magicquotes.disabling | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-157202@lists.php.net to get a copy of this message | ||
I have recently found out that magic quotes affects not only the values of the GPC arrays, but also
the keys.
For now, my way to solve with the problem is:
<?php
if (get_magic_quotes_gpc()) {
function magicQuotes_awStripslashes(&$value, $key) {$value = stripslashes($value);}
$gpc = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
array_walk_recursive($gpc, 'magicQuotes_awStripslashes');
}
?>
Unfortunately it doesn't fix the keys... and cannot determinate if the slashes are already
stripped.
----
Server IP: 89.190.194.18
Probable Submitter: 77.85.113.6
----
Manual Page -- http://www.php.net/manual/en/security.magicquotes.disabling.php
Edit -- https://master.php.net/note/edit/91653
Del: integrated -- https://master.php.net/note/delete/91653/integrated
Del: useless -- https://master.php.net/note/delete/91653/useless
Del: bad code -- https://master.php.net/note/delete/91653/bad+code
Del: spam -- https://master.php.net/note/delete/91653/spam
Del: non-english -- https://master.php.net/note/delete/91653/non-english
Del: in docs -- https://master.php.net/note/delete/91653/in+docs
Del: other reasons-- https://master.php.net/note/delete/91653
Reject -- https://master.php.net/note/reject/91653
Search -- https://master.php.net/manage/user-notes.php