MDL-43528 remove all traces of magic quotes hacking from moodle core
This commit is contained in:
@@ -696,39 +696,6 @@ ini_set('pcre.backtrack_limit', 20971520); // 20 MB
|
||||
$CFG->wordlist = $CFG->libdir .'/wordlist.txt';
|
||||
$CFG->moddata = 'moddata';
|
||||
|
||||
// A hack to get around magic_quotes_gpc being turned on
|
||||
// It is strongly recommended to disable "magic_quotes_gpc"!
|
||||
if (ini_get_bool('magic_quotes_gpc')) {
|
||||
function stripslashes_deep($value) {
|
||||
$value = is_array($value) ?
|
||||
array_map('stripslashes_deep', $value) :
|
||||
stripslashes($value);
|
||||
return $value;
|
||||
}
|
||||
$_POST = array_map('stripslashes_deep', $_POST);
|
||||
$_GET = array_map('stripslashes_deep', $_GET);
|
||||
$_COOKIE = array_map('stripslashes_deep', $_COOKIE);
|
||||
$_REQUEST = array_map('stripslashes_deep', $_REQUEST);
|
||||
if (!empty($_SERVER['REQUEST_URI'])) {
|
||||
$_SERVER['REQUEST_URI'] = stripslashes($_SERVER['REQUEST_URI']);
|
||||
}
|
||||
if (!empty($_SERVER['QUERY_STRING'])) {
|
||||
$_SERVER['QUERY_STRING'] = stripslashes($_SERVER['QUERY_STRING']);
|
||||
}
|
||||
if (!empty($_SERVER['HTTP_REFERER'])) {
|
||||
$_SERVER['HTTP_REFERER'] = stripslashes($_SERVER['HTTP_REFERER']);
|
||||
}
|
||||
if (!empty($_SERVER['PATH_INFO'])) {
|
||||
$_SERVER['PATH_INFO'] = stripslashes($_SERVER['PATH_INFO']);
|
||||
}
|
||||
if (!empty($_SERVER['PHP_SELF'])) {
|
||||
$_SERVER['PHP_SELF'] = stripslashes($_SERVER['PHP_SELF']);
|
||||
}
|
||||
if (!empty($_SERVER['PATH_TRANSLATED'])) {
|
||||
$_SERVER['PATH_TRANSLATED'] = stripslashes($_SERVER['PATH_TRANSLATED']);
|
||||
}
|
||||
}
|
||||
|
||||
// neutralise nasty chars in PHP_SELF
|
||||
if (isset($_SERVER['PHP_SELF'])) {
|
||||
$phppos = strpos($_SERVER['PHP_SELF'], '.php');
|
||||
|
||||
Reference in New Issue
Block a user