From 9384419a4f62c151421d58615fb65d5e7f88fbb1 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Mon, 27 Sep 2010 15:41:46 +0000 Subject: [PATCH] MDL-24368 prevent infinite loops when caching can not be disabled --- admin/cron.php | 5 ++++- admin/index.php | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/admin/cron.php b/admin/cron.php index eed68d31b52..5ea34e6489d 100644 --- a/admin/cron.php +++ b/admin/cron.php @@ -77,7 +77,10 @@ if (check_browser_version('MSIE')) { // no more headers and buffers @ob_implicit_flush(true); while(ob_get_level()) { - ob_end_clean(); + if (!ob_end_clean()) { + // prevent infinite loop + break; + } } // execute the cron diff --git a/admin/index.php b/admin/index.php index b586badac70..01e4057829f 100644 --- a/admin/index.php +++ b/admin/index.php @@ -41,7 +41,10 @@ if (version_compare(phpversion(), '5.2.0') < 0) { // try to flush everything all the time @ob_implicit_flush(true); while(ob_get_level()) { - ob_end_clean(); // ob_end_flush prevents sending of headers + if (!ob_end_clean()) { + // prevent infinite loop + break; + } } require('../config.php'); -- 2.43.0