note 95048 deleted from function.mysql-real-escape-string by danbrown

From: Date: Thu, 10 Dec 2009 19:12:36 +0000
Subject: note 95048 deleted from function.mysql-real-escape-string by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-163827@lists.php.net to get a copy of this message
Note Submitter: aj at gliffenc dot om ---- My Thanks to alan_a_williams [at] hotmail [dot] com. I have adapted your little script to allow for posted arrays. function Cleaner($value){ if (is_array($value)){ $value=array_map('trim', $value); if(get_magic_quotes_gpc()){$value=array_map('stripslashes', $value);} $value=array_map('mysql_real_escape_string', $value); } else{ $value=trim($value); if(get_magic_quotes_gpc()){$value=stripslashes($value);} $value=mysql_real_escape_string($value); } return $value; } $_GET = array_map('Cleaner', $_GET); $_POST = array_map('Cleaner', $_POST); $_COOKIE = array_map('Cleaner', $_COOKIE); $_REQUEST = array_map('Cleaner', $_REQUEST);

« previous php.notes (#163827) next »