* (bug 11795) Be more paranoid about confirming accept-encoding header is present
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 29 Oct 2007 17:41:55 +0000 (17:41 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 29 Oct 2007 17:41:55 +0000 (17:41 +0000)
RELEASE-NOTES
includes/OutputHandler.php

index 2d9412a..dcf93d7 100644 (file)
@@ -120,6 +120,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 11744) Incorrect return value from Title::getParentCategories()
 * (bug 11762) Fix native language name of Akan (ak)
 * (bug 11722) Fix inconsistent case in unprotect tabs
+* (bug 11795) Be more paranoid about confirming accept-encoding header is present
 
 === API changes in 1.12 ===
 
index d8ac12b..dd36498 100644 (file)
@@ -61,10 +61,12 @@ function wfGzipHandler( $s ) {
                return $s;
        }
        
-       $tokens = preg_split( '/[,; ]/', $_SERVER['HTTP_ACCEPT_ENCODING'] );
-       if ( in_array( 'gzip', $tokens ) ) {
-               header( 'Content-Encoding: gzip' );
-               $s = gzencode( $s, 3 );
+       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, 3 );
+               }
        }
        
        // Set vary header if it hasn't been set already