]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12592 do not execute theme_setup() if header already printed; merged from MOODLE_...
authorskodak <skodak>
Sat, 15 Dec 2007 16:53:39 +0000 (16:53 +0000)
committerskodak <skodak>
Sat, 15 Dec 2007 16:53:39 +0000 (16:53 +0000)
lib/weblib.php

index 9d386995394cb0f060942fcbe4fb324a0f7e04d2..3d17e66aa7d82e629372ae9c67f771ee3bb59c47 100644 (file)
@@ -3187,6 +3187,11 @@ function theme_setup($theme = '', $params=NULL) {
 
     global $CFG, $THEME, $SESSION, $USER, $HTTPSPAGEREQUIRED;
 
+/// Do not mess with THEME if header already printed - this would break all the extra stuff in global $THEME from print_header()!!
+    if (defined('HEADER_PRINTED')) {
+        return;
+    }
+
     if (empty($theme)) {
         $theme = current_theme();
     }
@@ -7029,4 +7034,4 @@ function is_in_popup() {
 
 
 // vim:autoindent:expandtab:shiftwidth=4:tabstop=4:tw=140:
-?>
\ No newline at end of file
+?>