From 98bda4fdc7bccbef714bd6480528804bcd3f5586 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Thu, 22 Jan 2009 22:50:10 +0100 Subject: fixed multiple gzip/sendfile problems in css and js dispatchers FS#1571 - Avoid double compression when gzip_output is enabled - Only compress when gzip_output is enabled - Do not use x-sendfile for compressed content (content-encoding is not supported) - Make sure the script terminates after using x-sendfile - Moved gzip browser support check to init.php darcs-hash:20090122215010-7ad00-765765d353ff78df5b8704086328c5c699bbe7e0.gz --- inc/init.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'inc/init.php') diff --git a/inc/init.php b/inc/init.php index 1d651812f..f577188e8 100644 --- a/inc/init.php +++ b/inc/init.php @@ -168,11 +168,11 @@ // increase PCRE backtrack limit @ini_set('pcre.backtrack_limit', '20971520'); - // enable gzip compression + // enable gzip compression if supported + $conf['gzip_output'] &= (strpos($_SERVER['HTTP_ACCEPT_ENCODING'],'gzip') !== false); if ($conf['gzip_output'] && !defined('DOKU_DISABLE_GZIP_OUTPUT') && - function_exists('ob_gzhandler') && - preg_match('/gzip|deflate/', $_SERVER['HTTP_ACCEPT_ENCODING'])) { + function_exists('ob_gzhandler')) { ob_start('ob_gzhandler'); } -- cgit v1.2.3