From 47c2811b9523cd91814468baf8e7f5937f75593c Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sat, 31 Oct 2009 22:22:08 +0000 Subject: [PATCH] MDL-20695 no need to log prefetch attempts, we can not prevent them --- lib/setup.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/setup.php b/lib/setup.php index 7ec63887c5..5b78230707 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -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 -- 2.39.5