Skip to content

Commit

Permalink
MDL-20695 no need to log prefetch attempts, we can not prevent them
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Oct 31, 2009
1 parent ccda6d6 commit 47c2811
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@
// 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
Expand Down Expand Up @@ -230,8 +232,8 @@
/// 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
Expand Down

0 comments on commit 47c2811

Please sign in to comment.