r79862 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79861‎ | r79862 | r79863 >
Date:15:41, 8 January 2011
Author:catrope
Status:ok
Tags:
Comment:
Attempt at fixing bug 26370, which seems to be an infinite loop caused by ob_get_level() never going all the way down to 0 no matter how many output buffers we destroy. Use a for loop instead
Modified paths:
  • /trunk/phase3/includes/resourceloader/ResourceLoader.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/resourceloader/ResourceLoader.php
@@ -377,7 +377,11 @@
378378 // See also http://bugs.php.net/bug.php?id=51579
379379 // To work around this, we tear down all output buffering before
380380 // sending the 304.
381 - while ( ob_get_level() > 0 ) {
 381+ // On some setups, ob_get_level() doesn't seem to go down to zero
 382+ // no matter how often we call ob_get_clean(), so instead of doing
 383+ // the more intuitive while ( ob_get_level() > 0 ) ob_get_clean();
 384+ // we have to be safe here and avoid an infinite loop.
 385+ for ( $i = 0; $i < ob_get_level(); $i++ ) {
382386 ob_end_clean();
383387 }
384388

Follow-up revisions

RevisionCommit summaryAuthorDate
r810091.17: MFT r79839, r79862, r79863, r79895, r80003, r80005, r80164, r80692catrope00:20, 26 January 2011
r97851followup r79862: the for loop only cleans up half the output handlers (since ...vyznev20:44, 22 September 2011

Status & tagging log