From 32613b509f52ebbe2eb0a11bc3bebc0a6b9b5761 Mon Sep 17 00:00:00 2001 From: moodler Date: Mon, 10 Apr 2006 14:40:39 +0000 Subject: [PATCH] Added a little static variable to print_header to prevent it being called twice --- lib/weblib.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/weblib.php b/lib/weblib.php index d0a07f37cd..33712659c8 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1849,6 +1849,15 @@ function print_header ($title='', $heading='', $navigation='', $focus='', $meta= global $USER, $CFG, $THEME, $SESSION, $ME, $SITE, $HTTPSPAGEREQUIRED; +/// This makes sure that the header is never repeated twice on a page + static $headerprinted = false; + + if ($headerprinted) { + return; + } else { + $headerprinted = true; + } + /// This is an ugly hack to be replaced later by a proper global $COURSE global $course; if (!empty($course->lang)) { -- 2.39.5