]> git.mjollnir.org Git - moodle.git/commitdiff
Catch another potential type of infinite recursion output initialisation.
authortjhunt <tjhunt>
Tue, 7 Jul 2009 04:37:12 +0000 (04:37 +0000)
committertjhunt <tjhunt>
Tue, 7 Jul 2009 04:37:12 +0000 (04:37 +0000)
lib/setuplib.php

index 8c8d354dacdb19be5463233237d0f697ea01764b..2e8f4abf92c10386c5f7e8a1620f353acaa36e4e 100644 (file)
@@ -788,8 +788,17 @@ class bootstrap_renderer {
     public function __call($method, $arguments) {
         global $OUTPUT, $PAGE;
 
+        $recursing = false;
+        if ($method == 'notification') {
+            // Catch infinite recursion cuased by debugging output during print_header.
+            $backtrace = debug_backtrace();
+            array_shift($backtrace);
+            array_shift($backtrace);
+            $recursing = is_stacktrace_during_output_init($backtrace);
+        }
+
         // If lib/outputlib.php has been loaded, call it.
-        if (!empty($PAGE)) {
+        if (!empty($PAGE) && !$recursing) {
             $PAGE->initialise_theme_and_output();
             return call_user_func_array(array($OUTPUT, $method), $arguments);
         }