From: Petr Skoda Date: Fri, 30 Oct 2009 12:46:16 +0000 (+0000) Subject: MDL-20676 improved protocol specification in fatal error headers - credit goes to... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=85309744d6b3d836b1853b85236d4531acde21a4;p=moodle.git MDL-20676 improved protocol specification in fatal error headers - credit goes to Martin Langhoff --- diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php index 02e26589c1..84ac2dde2d 100644 --- a/lib/outputrenderers.php +++ b/lib/outputrenderers.php @@ -1928,7 +1928,11 @@ class moodle_core_renderer extends moodle_renderer_base { $output .= $this->opencontainers->pop_all_but_last(); } else { // Header not yet printed - @header('HTTP/1.0 404 Not Found'); + if (isset($_SERVER['SERVER_PROTOCOL'])) { + // server protocol should be always present, because this render + // can not be used from command line or when outputting custom XML + @header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found'); + } $this->page->set_title(get_string('error')); $output .= $this->header(); }