From 36781c5b4ca7059457fd7f536f655cbb07df5139 Mon Sep 17 00:00:00 2001 From: Platonides Date: Tue, 15 Mar 2011 22:22:57 +0000 Subject: [PATCH] (Bug 28069) MediaWiki fails streaming files when mod_deflate and ob_gzhandler are also set gzipped content with header: "Content-Encoding: , gzip" --- includes/GlobalFunctions.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index bdb18b8496..e07b5e14ba 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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; } } -- 2.20.1