note 93005 deleted from function.mysql-real-escape-string by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 11:15:57 +0000 |
| Subject: | note 93005 deleted from function.mysql-real-escape-string by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-197052@lists.php.net to get a copy of this message | ||
Note Submitter: alan_a_williams [at] hotmail [dot] com
----
Just a little something I like to use....
$_GET = array_map('trim', $_GET);
$_POST = array_map('trim', $_POST);
$_COOKIE = array_map('trim', $_COOKIE);
$_REQUEST = array_map('trim', $_REQUEST);
if(get_magic_quotes_gpc()):
$_GET = array_map('stripslashes', $_GET);
$_POST = array_map('stripslashes', $_POST);
$_COOKIE = array_map('stripslashes', $_COOKIE);
$_REQUEST = array_map('stripslashes', $_REQUEST);
endif;
$_GET = array_map('mysql_real_escape_string', $_GET);
$_POST = array_map('mysql_real_escape_string', $_POST);
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
$_REQUEST = array_map('mysql_real_escape_string', $_REQUEST);
Seems to do the trick ALOT of the time, but I'm going to be honest, it can be a [EDITED]
sometimes >_>