]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20695 no need to log prefetch attempts, we can not prevent them
authorPetr Skoda <skodak@moodle.org>
Sat, 31 Oct 2009 22:22:08 +0000 (22:22 +0000)
committerPetr Skoda <skodak@moodle.org>
Sat, 31 Oct 2009 22:22:08 +0000 (22:22 +0000)
lib/setup.php

index 7ec63887c53d09502ad8c22e09cde1eb9631fb73..5b78230707081bf79328a104db9e8c9e1fa71065 100644 (file)
@@ -171,7 +171,9 @@ if (!defined('NO_DEBUG_DISPLAY')) {
 // wwwroot is mandatory
 if (!isset($CFG->wwwroot)) {
     // trigger_error() is not correct here, no need to log this
-    die('Fatal: $CFG->wwwroot is not configured! Exiting.');
+    header($_SERVER['SERVER_PROTOCOL'] . ' 503 Service Unavailable');
+    echo('Fatal: $CFG->wwwroot is not configured! Exiting.');
+    exit(1);
 }
 
 /// Detect CLI scripts - CLI scripts are executed from command line, do not have session and we do not want HTML in output
@@ -230,8 +232,8 @@ if (!isset($CFG->wwwroot)) {
 /// http://www.google.com/webmasters/faq.html#prefetchblock
     if (!empty($_SERVER['HTTP_X_moz']) && $_SERVER['HTTP_X_moz'] === 'prefetch'){
         header($_SERVER['SERVER_PROTOCOL'] . ' 404 Prefetch Forbidden');
-        trigger_error('Prefetch request forbidden.');
-        exit;
+        echo('Prefetch request forbidden.');
+        exit(1);
     }
 
 /// Define admin directory