From: Antoine Musso Date: Thu, 9 Feb 2012 11:02:36 +0000 (+0000) Subject: (bug 34254) fix gzipped file cache double compressing output X-Git-Tag: 1.31.0-rc.0~24835 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=311bc79c88a5cd60284c04ab041ce8ea1de2a931;p=lhc%2Fweb%2Fwiklou.git (bug 34254) fix gzipped file cache double compressing output A gzipped file cache is enabled by setting $wgUseGzip and $wgUseFileCache. To save CPU cycles, HTMLFileCache would print the compressed output as is but WebStart uses an ob_gzhandler so we end up with a double compression. --- diff --git a/RELEASE-NOTES-1.20 b/RELEASE-NOTES-1.20 index 6fedda980d..1f6a1fc6eb 100644 --- a/RELEASE-NOTES-1.20 +++ b/RELEASE-NOTES-1.20 @@ -18,6 +18,8 @@ production. * (bug 30245) Use the correct way to construct a log page title. * (bug 34237) Regenerate an empty user_token and save to the database when we try to set the user's cookies for login. +* (bug 34254) Using a gzipped file cache ($wgUseGzip and $wgUseFileCache) + compressed the output twice resulting in garbage output (since 1.18) === API changes in 1.20 === diff --git a/includes/Setup.php b/includes/Setup.php index 1e0ab0b8bb..1cf171ae7a 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -388,6 +388,12 @@ if ( $wgCanonicalServer === false ) { $wgCanonicalServer = wfExpandUrl( $wgServer, PROTO_HTTP ); } +if ( $wgUseFileCache && $wgUseGzip ) { + // Bypass any previous output handler to avoid double + // compression (bug 34254) + wfResetOutputBuffers(); +} + wfProfileIn( $fname . '-misc1' ); # Raise the memory limit if it's too low