(Bug 28069) MediaWiki fails streaming files when mod_deflate and ob_gzhandler are...
authorPlatonides <platonides@users.mediawiki.org>
Tue, 15 Mar 2011 22:22:57 +0000 (22:22 +0000)
committerPlatonides <platonides@users.mediawiki.org>
Tue, 15 Mar 2011 22:22:57 +0000 (22:22 +0000)
gzipped content with header: "Content-Encoding: , gzip"

includes/GlobalFunctions.php

index bdb18b8..e07b5e1 100644 (file)
@@ -1599,7 +1599,13 @@ function wfResetOutputBuffers( $resetGzipEncoding = true ) {
                        if( $status['name'] == 'ob_gzhandler' ) {
                                // Reset the 'Content-Encoding' field set by this handler
                                // so we can start fresh.
-                               header( 'Content-Encoding:' );
+                               if ( function_exists( 'header_remove' ) ) {
+                                       // Available since PHP 5.3.0
+                                       header_remove( 'Content-Encoding' );
+                               } else {
+                                       // We need to provide a valid content-coding. See bug 28069
+                                       header( 'Content-Encoding: identity' );
+                               }
                                break;
                        }
                }