From 311bc79c88a5cd60284c04ab041ce8ea1de2a931 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Thu, 9 Feb 2012 11:02:36 +0000 Subject: [PATCH] (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. --- RELEASE-NOTES-1.20 | 2 ++ includes/Setup.php | 6 ++++++ 2 files changed, 8 insertions(+) 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 -- 2.20.1