From: skodak <skodak> Date: Thu, 1 May 2008 21:53:10 +0000 (+0000) Subject: MDL-14617 ancient register globals hack removed X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=a648b6a8f151764250827a644fc784aa3352dadc;p=moodle.git MDL-14617 ancient register globals hack removed --- diff --git a/lib/setup.php b/lib/setup.php index ac9b43e419..05bb3812de 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -481,39 +481,6 @@ global $HTTPSPAGEREQUIRED; } } - -/// The following code can emulate "register globals" if required. -/// This hack is no longer being applied as of Moodle 1.6 unless you really -/// really want to use it (by defining $CFG->enableglobalshack = true) - - if (!empty($CFG->enableglobalshack) && !defined('MOODLE_SANE_INPUT')) { - if (!empty($CFG->detect_unchecked_vars)) { - global $UNCHECKED_VARS; - $UNCHECKED_VARS->url = $_SERVER['PHP_SELF']; - $UNCHECKED_VARS->vars = array(); - } - if (isset($_GET)) { - extract($_GET, EXTR_SKIP); // Skip existing variables, ie CFG - if (!empty($CFG->detect_unchecked_vars)) { - foreach ($_GET as $key => $val) { - $UNCHECKED_VARS->vars[$key]=$val; - } - } - } - if (isset($_POST)) { - extract($_POST, EXTR_SKIP); // Skip existing variables, ie CFG - if (!empty($CFG->detect_unchecked_vars)) { - foreach ($_POST as $key => $val) { - $UNCHECKED_VARS->vars[$key]=$val; - } - } - } - if (isset($_SERVER)) { - extract($_SERVER); - } - } - - /// Load up global environment variables if (!isset($CFG->cookiesecure) or strpos($CFG->wwwroot, 'https://') !== 0) {