From 87b6851cf97d4ef98c7464fc20d7b8dfe711f82c Mon Sep 17 00:00:00 2001 From: tjhunt Date: Tue, 7 Jul 2009 04:37:12 +0000 Subject: [PATCH] Catch another potential type of infinite recursion output initialisation. --- lib/setuplib.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/setuplib.php b/lib/setuplib.php index 8c8d354dac..2e8f4abf92 100644 --- a/lib/setuplib.php +++ b/lib/setuplib.php @@ -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); } -- 2.39.5