r61054 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61053‎ | r61054 | r61055 >
Date:16:35, 14 January 2010
Author:platonides
Status:resolved (Comments)
Tags:
Comment:
(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.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/OutputHandler.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -1167,8 +1167,7 @@
11681168 * @return bool Whereas client accept gzip compression
11691169 */
11701170 function wfClientAcceptsGzip() {
1171 - global $wgUseGzip;
1172 - if( $wgUseGzip ) {
 1171+ if( isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) {
11731172 # FIXME: we may want to blacklist some broken browsers
11741173 $m = array();
11751174 if( preg_match(
Index: trunk/phase3/includes/OutputHandler.php
@@ -74,12 +74,9 @@
7575 return $s;
7676 }
7777
78 - if( isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) ) {
79 - $tokens = preg_split( '/[,; ]/', $_SERVER['HTTP_ACCEPT_ENCODING'] );
80 - if ( in_array( 'gzip', $tokens ) ) {
81 - header( 'Content-Encoding: gzip' );
82 - $s = gzencode( $s, 6 );
83 - }
 78+ if( wfClientAcceptsGzip() ) {
 79+ header( 'Content-Encoding: gzip' );
 80+ $s = gzencode( $s, 6 );
8481 }
8582
8683 // Set vary header if it hasn't been set already
Index: trunk/phase3/RELEASE-NOTES
@@ -706,6 +706,8 @@
707707 * (bug 14717) Don't load nonexistent CSS fix files for non-Monobook skins
708708 * (bug 18765) Increased consistency of bold-italic markup for unbalanced quotes.
709709 Improved representation of six quotes (may break existing markup).
 710+* (bug 22034) Use wfClientAcceptsGzip() in wfGzipHandler instead of
 711+ reimplementing it.
710712
711713 == API changes in 1.16 ==
712714
@@ -811,13 +813,13 @@
812814 * Add Estonian letters äöõšüž to linktrail (et)
813815 * (bug 18776) Native name of Burmese language (my)
814816 * (bug 18806) Use correct unicode characters in spelling of native Chuvash
815 - (Чӑвашла)
 817+ (???????)
816818 * (bug 18864) Updated autonym for Zhuang language
817819 * (bug 18308) Updated date formatting in Occitan (oc)
818 -* (bug 19080) Added ăâîşţșțĂÂÎŞŢȘȚ to Romanion (ro) linktrail
 820+* (bug 19080) Added aâîst??AÂÎST?? to Romanion (ro) linktrail
819821 * (bug 19286) Correct commafying function in Polish (pl)
820822 * (bug 19441) Updated date formatting for Lithuanian
821 -* (bug 19630) Added ÄäÇçĞğŇňÖöŞşÜüÝýŽž to Turkmen (tk) linktrail
 823+* (bug 19630) Added ÄäÇçGgNnÖöSsÜüÝýŽž to Turkmen (tk) linktrail
822824 * (bug 19949) New linktrail for Greek (el)
823825 * (bug 19809) Korean (North Korea) (ko-kp) (new)
824826 * (bug 19968) Fixed "Project talk" namespace name for Maltese (mt)
@@ -893,4 +895,4 @@
894896
895897 === IRC help ===
896898
897 -There's usually someone online in #mediawiki on irc.freenode.net
 899+There's usually someone online
\ No newline at end of file

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r60864(bug 22034) Use wfClientAcceptsGzip() in wfGzipHandler. Patch by Platonides....siebrand18:10, 9 January 2010

Comments

#Comment by Bryan (talk | contribs)   21:31, 14 January 2010

Broken UTF8 and broken last line in RELEASE-NOTES.

Also I wonder whether the comment in DefaultSettings is still correct:

/** * When using the file cache, we can store the cached HTML gzipped to save disk * space. Pages will then also be served compressed to clients that support it. * THIS IS NOT COMPATIBLE with ob_gzhandler which is now enabled if supported in * the default LocalSettings.php! If you enable this, remove that setting first. * * Requires zlib support enabled in PHP. */

#Comment by Bryan (talk | contribs)   21:41, 14 January 2010

Broken UTF8 and RELEASE-NOTES fixed in r61055.

Status & tagging log