https://bugzilla.wikimedia.org/show_bug.cgi?id=61359

            Bug ID: 61359
           Summary: Resource Loader tryRespondLastModified has a poorly
                    written loop when clearing the output buffer.
           Product: MediaWiki
           Version: 1.19.1
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: major
          Priority: Unprioritized
         Component: ResourceLoader
          Assignee: wikibugs-l@lists.wikimedia.org
          Reporter: necro...@gmail.com
                CC: krinklem...@gmail.com, roan.katt...@gmail.com,
                    tpars...@wikimedia.org
       Web browser: ---
   Mobile Platform: ---

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();
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to