]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20676 improved protocol specification in fatal error headers - credit goes to...
authorPetr Skoda <skodak@moodle.org>
Fri, 30 Oct 2009 12:46:16 +0000 (12:46 +0000)
committerPetr Skoda <skodak@moodle.org>
Fri, 30 Oct 2009 12:46:16 +0000 (12:46 +0000)
lib/outputrenderers.php

index 02e26589c1e5f37a97805fe26ef3e58ee16dba43..84ac2dde2db10474c2589c350a191e4e652d8356 100644 (file)
@@ -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();
         }