Check if $_SERVER['HTTP_ACCEPT_ENCODING'] is set before determining whether to compress scripts, props nacin, fixes #11169

git-svn-id: https://develop.svn.wordpress.org/trunk@12214 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2009-11-19 09:46:07 +00:00
parent 7c3f9cf02b
commit 8066de0726
4 changed files with 13 additions and 3 deletions
+2
View File
@@ -91,6 +91,8 @@ case 'wp-compression-test' :
echo $test_str;
die;
} elseif ( 2 == $_GET['test'] ) {
if ( !isset($_SERVER['HTTP_ACCEPT_ENCODING']) )
die('-1');
if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
header('Content-Encoding: deflate');
$out = gzdeflate( $test_str, 1 );