From 455feda3ac49e84675ad6f88c444d51dcbdbd43e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 29 Oct 2007 17:41:55 +0000 Subject: [PATCH] * (bug 11795) Be more paranoid about confirming accept-encoding header is present --- RELEASE-NOTES | 1 + includes/OutputHandler.php | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2d9412ad39..dcf93d7765 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -120,6 +120,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 11744) Incorrect return value from Title::getParentCategories() * (bug 11762) Fix native language name of Akan (ak) * (bug 11722) Fix inconsistent case in unprotect tabs +* (bug 11795) Be more paranoid about confirming accept-encoding header is present === API changes in 1.12 === diff --git a/includes/OutputHandler.php b/includes/OutputHandler.php index d8ac12b531..dd3649804a 100644 --- a/includes/OutputHandler.php +++ b/includes/OutputHandler.php @@ -61,10 +61,12 @@ function wfGzipHandler( $s ) { return $s; } - $tokens = preg_split( '/[,; ]/', $_SERVER['HTTP_ACCEPT_ENCODING'] ); - if ( in_array( 'gzip', $tokens ) ) { - header( 'Content-Encoding: gzip' ); - $s = gzencode( $s, 3 ); + 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 ); + } } // Set vary header if it hasn't been set already -- 2.20.1