note 18532 added to function.set-magic-quotes-runtime

From: Date: Sat, 26 Jan 2002 18:23:04 +0000
Subject: note 18532 added to function.set-magic-quotes-runtime
Groups: php.notes 
Request: Send a blank email to php-notes+get-25851@lists.php.net to get a copy of this message
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. -- http://www.php.net/manual/en/function.set-magic-quotes-runtime.php http://master.php.net/manage/user-notes.php?action=edit+18532 http://master.php.net/manage/user-notes.php?action=delete+18532 http://master.php.net/manage/user-notes.php?action=reject+18532

« previous php.notes (#25851) next »