From 138b92ce7f016491c7ad76680eadd39a2a8a51e8 Mon Sep 17 00:00:00 2001 From: skodak Date: Sat, 15 Dec 2007 16:52:27 +0000 Subject: [PATCH] MDL-12592 do not execute theme_setup() if header already printed --- lib/weblib.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/weblib.php b/lib/weblib.php index 379a95d4e50..3d17e66aa7d 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -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(); }