http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97851
Revision: 97851
Author: vyznev
Date: 2011-09-22 20:44:05 +0000 (Thu, 22 Sep 2011)
Log Message:
-----------
followup r79862: the for loop only cleans up half the output handlers (since $i
counts up while ob_get_level() counts down); check the return value of
ob_end_clean() instead.
(I just noticed this while eyeballing the code -- apparently most people don't
have multiple output handlers active, given that nobody had caught this in over
eight months.)
Modified Paths:
--------------
trunk/phase3/includes/resourceloader/ResourceLoader.php
Modified: trunk/phase3/includes/resourceloader/ResourceLoader.php
===================================================================
--- trunk/phase3/includes/resourceloader/ResourceLoader.php 2011-09-22
20:34:55 UTC (rev 97850)
+++ trunk/phase3/includes/resourceloader/ResourceLoader.php 2011-09-22
20:44:05 UTC (rev 97851)
@@ -462,9 +462,10 @@
// On some setups, ob_get_level() doesn't seem
to go down to zero
// no matter how often we call ob_get_clean(),
so instead of doing
// the more intuitive while ( ob_get_level() >
0 ) ob_get_clean();
- // we have to be safe here and avoid an
infinite loop.
- for ( $i = 0; $i < ob_get_level(); $i++ ) {
- ob_end_clean();
+ // we have to be safe here and check the return
value to avoid an
+ // infinite loop. (bug 26370)
+ while ( ob_get_level() > 0 && ob_end_clean() ) {
+ // repeat
}
header( 'HTTP/1.0 304 Not Modified' );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs