Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F6248
bug_22034_(2nd_version).patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
•
bzimport
Nov 21 2014, 10:53 PM
2014-11-21 22:53:14 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
bug_22034_(2nd_version).patch
View Options
Index: GlobalFunctions.php
===================================================================
--- GlobalFunctions.php (revision 60836)
+++ GlobalFunctions.php (working copy)
@@ -1167,8 +1167,7 @@
* @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(
Index: OutputHandler.php
===================================================================
--- OutputHandler.php (revision 60836)
+++ OutputHandler.php (working copy)
@@ -74,12 +74,9 @@
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
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5795
Default Alt Text
bug_22034_(2nd_version).patch (1 KB)
Attached To
Mode
T24034: Use wfClientAcceptsGzip() in wfGzipHandler
Attached
Detach File
Event Timeline
Log In to Comment