note 110865 added to function.get-magic-quotes-gpc
| From: | Lucifer | Date: | Mon, 17 Dec 2012 09:16:19 +0000 |
| Subject: | note 110865 added to function.get-magic-quotes-gpc | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-192559@lists.php.net to get a copy of this message | ||
@Alix Axel's solution can't work at PHP5.2 because json_encode only receives 1 parameter.
Here is my solution:
<?php
function ref_stripslashes(&$value,$key) {
$value = stripslashes($value);
}
if((function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()) ||
(ini_get('magic_quotes_sybase') &&
(strtolower(ini_get('magic_quotes_sybase'))!="off")) ) {
array_walk_recursive($_GET,'ref_stripslashes');
array_walk_recursive($_POST,'ref_stripslashes');
array_walk_recursive($_COOKIE,'ref_stripslashes');
}
?>
----
Server IP: 69.147.83.199
Probable Submitter: 112.193.122.239
----
Manual Page -- http://php.net/manual/en/function.get-magic-quotes-gpc.php
Edit -- https://master.php.net/note/edit/110865
Del: integrated -- https://master.php.net/note/delete/110865/integrated
Del: useless -- https://master.php.net/note/delete/110865/useless
Del: bad code -- https://master.php.net/note/delete/110865/bad+code
Del: spam -- https://master.php.net/note/delete/110865/spam
Del: non-english -- https://master.php.net/note/delete/110865/non-english
Del: in docs -- https://master.php.net/note/delete/110865/in+docs
Del: other reasons-- https://master.php.net/note/delete/110865
Reject -- https://master.php.net/note/reject/110865
Search -- https://master.php.net/manage/user-notes.php