Re: php.ini setting
| From: | Stephen | Date: | Sun, 02 Oct 2011 16:41:40 +0000 |
| Subject: | Re: php.ini setting | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-315113@lists.php.net to get a copy of this message | ||
On 11-10-02 12:12 PM, Jim Giner wrote:
Spoke to quickly - still having issues. While the .ini file in each of my appl. folders has magic quotes set to Off, my scripts are still escaping my input - obviously following the server's .ini file settings. Waiting for my hosters to get back to me. You could refer them to:http://php.net/manual/en/security.magicquotes.php Indicate that magic quotes have deprecated, and ask them to turn them off. But they will say "no", because of all the other users on the server that you use. In the end, you will be left with stripping the slashes on your own: <?php if (get_magic_quotes_gpc()) {
$process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
while (list($key, $val) = each($process)) {
foreach ($val as $k => $v) {
unset($process[$key][$k]);
if (is_array($v)) {
$process[$key][stripslashes($k)] = $v;
$process[] = &$process[$key][stripslashes($k)];
} else {
$process[$key][stripslashes($k)] = stripslashes($v);
}
}
}
unset($process);
}
?>
I know it is not the answer you are looking for, but it does work, and used by thousands of coders.
Stephen