Last modified: 2014-02-25 15:43:53 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T63359, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 61359 - Resource Loader tryRespondLastModified has a poorly written loop when clearing the output buffer.
Resource Loader tryRespondLastModified has a poorly written loop when clearin...
Status: RESOLVED DUPLICATE of bug 46836
Product: MediaWiki
Classification: Unclassified
ResourceLoader (Other open bugs)
1.19.1
All All
: Unprioritized major (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-02-14 03:46 UTC by Jon
Modified: 2014-02-25 15:43 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jon 2014-02-14 03:46:44 UTC
Applies to:
protected function tryRespondLastModified( ResourceLoaderContext $context, $mtime )

The function is small, so I'll let the code speak for itself. Basically, in the existing version the value retuned by ob_get_level() will count down as $i counts up - this results in only half of the ob levels getting cleared. Ultimately, this leads to bytes in the body section of the 304 (which is illegal and chokes browsers).

Here is the existing code: 
for ( $i = 0; $i < ob_get_level(); $i++ ) {
    ob_end_clean();
}

Here is what it should be:
$tmp = ob_get_level();
for ( $i = 0; $i < $tmp; $i++ ) {
   ob_end_clean();
}
Comment 1 Umherirrender 2014-02-14 22:05:25 UTC
Looks like this is already handled in master with bug 46836
Comment 2 Andre Klapper 2014-02-25 15:43:53 UTC
Yeah, this is bug 46836 comment 5. Thanks for catching this, Umherirrender!

Jon: In case you would like to propose the patch for backporting to a future 1.19.x tarball release, please add a comment to bug 46836. Thanks!

*** This bug has been marked as a duplicate of bug 46836 ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links