strip slashes from $_GET, $_POST, ... if magic quotes is on

This commit is contained in:
Uwe Steinmann 2014-01-07 08:39:34 +01:00
parent a1cea0f593
commit 713a387231

View File

@ -73,4 +73,19 @@ if(isset($settings->_extraPath))
if(isset($settings->_maxExecutionTime))
ini_set('max_execution_time', $settings->_maxExecutionTime);
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);
}
?>