]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-14617 ancient register globals hack removed
authorskodak <skodak>
Thu, 1 May 2008 21:53:10 +0000 (21:53 +0000)
committerskodak <skodak>
Thu, 1 May 2008 21:53:10 +0000 (21:53 +0000)
lib/setup.php

index ac9b43e41988e4e068d64cd99d7bf997512709c8..05bb3812de98fbce6676ee7d1e550d2f2ea460ca 100644 (file)
@@ -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) {