MDL-10275 added fatal PHP config setting test on each page, replaces some tests done in installer

This commit is contained in:
skodak
2009-02-01 13:37:42 +00:00
parent b3d960e64a
commit fbf2c91e43
5 changed files with 27 additions and 17 deletions
+3 -6
View File
@@ -86,12 +86,6 @@ global $FULLSCRIPT;
/** Relative moodle script path "/course/view.php" */
global $SCRIPT;
/// First try to detect some attacks on older buggy PHP versions
if (isset($_REQUEST['GLOBALS']) || isset($_COOKIE['GLOBALS']) || isset($_FILES['GLOBALS'])) {
die('Fatal: Illegal GLOBALS overwrite attempt detected!');
}
if (!isset($CFG->wwwroot)) {
trigger_error('Fatal: $CFG->wwwroot is not configured! Exiting.');
die;
@@ -170,6 +164,9 @@ global $SCRIPT;
/// set handler for uncought exceptions - equivalent to print_error() call
set_exception_handler('default_exception_handler');
/// make sure PHP is not severly misconfigured
setup_validate_php_configuration();
/// Connect to the database
setup_DB();