Don't suppress gzip mode for zero-length output; failing to send the
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 20 Feb 2007 04:58:54 +0000 (04:58 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 20 Feb 2007 04:58:54 +0000 (04:58 +0000)
Content-Encoding header with 304 responses confuses some browsers.

includes/OutputHandler.php

index 9272b19..b25cb4f 100644 (file)
@@ -22,7 +22,7 @@ function wfOutputHandler( $s ) {
  * Unlike ob_gzhandler, it works for HEAD requests too.
  */
 function wfGzipHandler( $s ) {
-       if ( $s !== '' && function_exists( 'gzencode' ) && !headers_sent() ) {
+       if ( function_exists( 'gzencode' ) && !headers_sent() ) {
                $tokens = preg_split( '/[,; ]/', $_SERVER['HTTP_ACCEPT_ENCODING'] );
                if ( in_array( 'gzip', $tokens ) ) {
                        header( 'Content-Encoding: gzip' );