* @parameter bool $resetGzipEncoding
*/
function wfResetOutputBuffers( $resetGzipEncoding=true ) {
+ if( $resetGzipEncoding ) {
+ // Suppress Content-Encoding and Content-Length
+ // headers from 1.10+s wfOutputHandler
+ global $wgDisableOutputCompression;
+ $wgDisableOutputCompression = true;
+ }
while( $status = ob_get_status() ) {
if( $status['type'] == 0 /* PHP_OUTPUT_HANDLER_INTERNAL */ ) {
// Probably from zlib.output_compression or other
// so we can start fresh.
header( 'Content-Encoding:' );
}
- if( $status['name'] == 'wfOutputHandler' ) {
- // And the custom handler in 1.10+ adds a Content-Length
- header( 'Content-Encoding:' );
- header( 'Content-Length:' );
- }
}
}
}
function wfOutputHandler( $s ) {
global $wgDisableOutputCompression;
$s = wfMangleFlashPolicy( $s );
- if ( !ini_get( 'zlib.output_compression' ) ) {
- if ( $wgDisableOutputCompression || !defined( 'MW_NO_OUTPUT_COMPRESSION' ) ) {
+ if ( !$wgDisableOutputCompression && !ini_get( 'zlib.output_compression' ) ) {
+ if ( !defined( 'MW_NO_OUTPUT_COMPRESSION' ) ) {
$s = wfGzipHandler( $s );
}
if ( !ini_get( 'output_handler' ) ) {