note 94681 deleted from function.addslashes by danbrown
| From: | danbrown@php.net | Date: | Wed, 18 Nov 2009 14:21:39 +0000 |
| Subject: | note 94681 deleted from function.addslashes by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-163024@lists.php.net to get a copy of this message | ||
Note Submitter: Augustine Alemcherry
----
Modifying aditya's code to take care of magic_quotes settings automatically. I hope the
following code in config file or something, which gets executed before any post variables are
processed will give excellent security irrespective of PHP settings.
if (!get_magic_quotes_gpc())
{
//create array to temporarily grab variables
$input_arr = array();
//grabs the $_POST variables and adds slashes
foreach ($_POST as $key => $input_arr)
{
$_POST[$key] = addslashes($input_arr);
}
}