Skip to content

Commit

Permalink
MDL-24368 prevent infinite loops when caching can not be disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Sep 27, 2010
1 parent 56048f8 commit 9384419
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion admin/cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@
// 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
Expand Down
5 changes: 4 additions & 1 deletion admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
// 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');
Expand Down

0 comments on commit 9384419

Please sign in to comment.