From da212102116818dd124c66348d4f9633be915425 Mon Sep 17 00:00:00 2001 From: Platonides Date: Thu, 14 Jan 2010 16:35:35 +0000 Subject: [PATCH] (bug 22034) use wfClientAcceptsGzip() in wfGzipHandler instead of reimplementing it. $wgUseGzip check on wfClientAcceptsGzip() is removed since HTMLFileCache (the only wfClientAcceptsGzip() user) already checked that before calling it. This way, $wgUseGzip stays applying only for file cache, and $wgDisableOutputCompression for output handler. --- RELEASE-NOTES | 10 ++++++---- includes/GlobalFunctions.php | 3 +-- includes/OutputHandler.php | 9 +++------ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2af828f242..5856d04a93 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -706,6 +706,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 14717) Don't load nonexistent CSS fix files for non-Monobook skins * (bug 18765) Increased consistency of bold-italic markup for unbalanced quotes. Improved representation of six quotes (may break existing markup). +* (bug 22034) Use wfClientAcceptsGzip() in wfGzipHandler instead of + reimplementing it. == API changes in 1.16 == @@ -811,13 +813,13 @@ changes to languages because of MediaZilla reports. * Add Estonian letters äöõšüž to linktrail (et) * (bug 18776) Native name of Burmese language (my) * (bug 18806) Use correct unicode characters in spelling of native Chuvash - (Чӑвашла) + (???????) * (bug 18864) Updated autonym for Zhuang language * (bug 18308) Updated date formatting in Occitan (oc) -* (bug 19080) Added ăâîşţșțĂÂÎŞŢȘȚ to Romanion (ro) linktrail +* (bug 19080) Added aâîst??AÂÎST?? to Romanion (ro) linktrail * (bug 19286) Correct commafying function in Polish (pl) * (bug 19441) Updated date formatting for Lithuanian -* (bug 19630) Added ÄäÇçĞğŇňÖöŞşÜüÝýŽž to Turkmen (tk) linktrail +* (bug 19630) Added ÄäÇçGgNnÖöSsÜüÝýŽž to Turkmen (tk) linktrail * (bug 19949) New linktrail for Greek (el) * (bug 19809) Korean (North Korea) (ko-kp) (new) * (bug 19968) Fixed "Project talk" namespace name for Maltese (mt) @@ -893,4 +895,4 @@ going to run a public MediaWiki, so you can be notified of security fixes. === IRC help === -There's usually someone online in #mediawiki on irc.freenode.net +There's usually someone online \ No newline at end of file diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 363b643f04..13833033b4 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1167,8 +1167,7 @@ function wfNumLink( $offset, $limit, $title, $query = '' ) { * @return bool Whereas client accept gzip compression */ function wfClientAcceptsGzip() { - global $wgUseGzip; - if( $wgUseGzip ) { + if( isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) { # FIXME: we may want to blacklist some broken browsers $m = array(); if( preg_match( diff --git a/includes/OutputHandler.php b/includes/OutputHandler.php index 061f7505ef..72e6562601 100644 --- a/includes/OutputHandler.php +++ b/includes/OutputHandler.php @@ -74,12 +74,9 @@ function wfGzipHandler( $s ) { return $s; } - if( isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) { - $tokens = preg_split( '/[,; ]/', $_SERVER['HTTP_ACCEPT_ENCODING'] ); - if ( in_array( 'gzip', $tokens ) ) { - header( 'Content-Encoding: gzip' ); - $s = gzencode( $s, 6 ); - } + if( wfClientAcceptsGzip() ) { + header( 'Content-Encoding: gzip' ); + $s = gzencode( $s, 6 ); } // Set vary header if it hasn't been set already -- 2.20.1