note 43545 added to function.get-magic-quotes-gpc

From: Date: Fri, 25 Jun 2004 00:15:53 +0000
Subject: note 43545 added to function.get-magic-quotes-gpc
Groups: php.notes 
Request: Send a blank email to php-notes+get-71626@lists.php.net to get a copy of this message
I recently encountered a situation where the keys of arrays in the $_POST vars were set_magic_quotes_runtime(0); function magicQuotesRemove(&$array) { if(!get_magic_quotes_gpc()) return; /* Prepare a new array */ $copy = array(); foreach($array as $key => $elem) { $copy[stripslashes($key)] = $elem; if(is_array($elem)) magicQuotesRemove($elem); else $elem = stripslashes($elem); $copy[stripslashes($key)] = $elem; } $array = $copy; } magicQuotesRemove($_GET); magicQuotesRemove($_POST); magicQuotesRemove($_COOKIE); magicQuotesRemove($_REQUEST); ---- Manual Page -- http://www.php.net/manual/en/function.get-magic-quotes-gpc.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+43545 Delete -- http://master.php.net/manage/user-notes.php?action=delete+43545&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+43545&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#71626) next »