* (bug 17537) Disable bad zlib.output_compression output on HTTP 304 responses
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 18 Mar 2009 21:26:57 +0000 (21:26 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 18 Mar 2009 21:26:57 +0000 (21:26 +0000)
Patch by ezyang - http://bug-attachment.wikimedia.org/attachment.cgi?id=5829

RELEASE-NOTES
includes/AjaxResponse.php
includes/OutputPage.php
includes/StreamFile.php

index 0e4bace..f201be7 100644 (file)
@@ -277,6 +277,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 11487) Special:Protectedpages doesn't list protections with pr_expiry
   IS NULL
 * (bug 18018) Deleting a file redirect leaves behind a malfunctioning redirect
+* (bug 17537) Disable bad zlib.output_compression output on HTTP 304 responses
 
 == API changes in 1.15 ==
 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions
index de6b3c5..26b6f44 100644 (file)
@@ -178,6 +178,7 @@ class AjaxResponse {
                        wfDebug( "$fname: -- client send If-Modified-Since: " . $modsince . "\n", false );
                        wfDebug( "$fname: --  we might send Last-Modified : $lastmod\n", false );
                        if( ($ismodsince >= $timestamp ) && $wgUser->validateCache( $ismodsince ) && $ismodsince >= $wgCacheEpoch ) {
+                               ini_set('zlib.output_compression', 0);
                                $this->setResponseCode( "304 Not Modified" );
                                $this->disable();
                                $this->mLastModified = $lastmod;
index ce35056..7fbd77b 100644 (file)
@@ -233,6 +233,7 @@ class OutputPage {
                # Not modified
                # Give a 304 response code and disable body output 
                wfDebug( __METHOD__ . ": NOT MODIFIED, $info\n", false );
+               ini_set('zlib.output_compression', 0);
                $wgRequest->response()->header( "HTTP/1.1 304 Not Modified" );
                $this->sendCacheControl();
                $this->disable();
index 4abd736..bdd2a2e 100644 (file)
@@ -48,6 +48,7 @@ function wfStreamFile( $fname, $headers = array() ) {
                $modsince = preg_replace( '/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE'] );
                $sinceTime = strtotime( $modsince );
                if ( $stat['mtime'] <= $sinceTime ) {
+                       ini_set('zlib.output_compression', 0);
                        header( "HTTP/1.0 304 Not Modified" );
                        return;
                }