From 222b01f5169f1c7e69762e0e8904c24f78f71882 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 28 Jul 2010 11:52:48 +0200 Subject: update to MediaWiki 1.16.0 --- includes/OutputHandler.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'includes/OutputHandler.php') diff --git a/includes/OutputHandler.php b/includes/OutputHandler.php index 1f4798b7..91819cc7 100644 --- a/includes/OutputHandler.php +++ b/includes/OutputHandler.php @@ -5,8 +5,8 @@ */ function wfOutputHandler( $s ) { global $wgDisableOutputCompression, $wgValidateAllHtml; - $s = wfMangleFlashPolicy( $s ); - if ( $wgValidateAllHtml ) { + $s = wfMangleFlashPolicy( $s ); + if ( $wgValidateAllHtml ) { $headers = apache_response_headers(); $isHTML = true; foreach ( $headers as $name => $value ) { @@ -37,7 +37,7 @@ function wfOutputHandler( $s ) { * @private */ function wfRequestExtension() { - /// @fixme -- this sort of dupes some code in WebRequest::getRequestUrl() + /// @todo Fixme: this sort of dupes some code in WebRequest::getRequestUrl() if( isset( $_SERVER['REQUEST_URI'] ) ) { // Strip the query string... list( $path ) = explode( '?', $_SERVER['REQUEST_URI'], 2 ); @@ -74,12 +74,9 @@ function wfGzipHandler( $s ) { return $s; } - 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 ); - } + if( wfClientAcceptsGzip() ) { + header( 'Content-Encoding: gzip' ); + $s = gzencode( $s, 6 ); } // Set vary header if it hasn't been set already @@ -93,7 +90,10 @@ function wfGzipHandler( $s ) { } if ( !$foundVary ) { header( 'Vary: Accept-Encoding' ); - header( 'X-Vary-Options: Accept-Encoding;list-contains=gzip' ); + global $wgUseXVO; + if ( $wgUseXVO ) { + header( 'X-Vary-Options: Accept-Encoding;list-contains=gzip' ); + } } return $s; } @@ -133,7 +133,7 @@ function wfHtmlValidationHandler( $s ) { $out = << - + HTML validation error