note 18532 deleted from function.set-magic-quotes-runtime by didou
| From: | didou@php.net | Date: | Thu, 29 May 2003 21:45:27 +0000 |
| Subject: | note 18532 deleted from function.set-magic-quotes-runtime by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-49331@lists.php.net to get a copy of this message | ||
Note Submitter: proforg@maloletka.ru
----
Well, this workaround won't work with arrays ...
You need at least change it to:
// Remove automatic quotes added to POST/COOKIE by PHP
if (get_magic_quotes_gpc ())
{
for (reset ($HTTP_POST_VARS); list ($k, $v) = each ($HTTP_POST_VARS);)
{
if(!is_array($v))
$$k = stripslashes ($v);
}
for (reset ($HTTP_COOKIE_VARS); list ($k, $v) = each ($HTTP_COOKIE_VARS); )
$$k = stripslashes ($v);
}
Actually you should apply stripslashes() for each element of array.