From 65f6e7d681429606c80d257b157e2af13f11e67a Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Fri, 24 Aug 2012 14:16:30 +0200 Subject: Disable compression when a compressed sitemap might be delivered FS#2576 Compressing a gzip file again for transport is standards compliant, but some clients assume that the file is only compressed once then and don't remove the outer compression layer. This could disable compression in too many cases theses cases should be rare and shouldn't cause any problems. --- inc/init.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'inc/init.php') diff --git a/inc/init.php b/inc/init.php index 00ab2afe9..4105225ea 100644 --- a/inc/init.php +++ b/inc/init.php @@ -129,9 +129,13 @@ if(!defined('DOKU_TPLINC')) define('DOKU_TPLINC', // enable gzip compression if supported $conf['gzip_output'] &= (strpos($_SERVER['HTTP_ACCEPT_ENCODING'],'gzip') !== false); +global $ACT; if ($conf['gzip_output'] && !defined('DOKU_DISABLE_GZIP_OUTPUT') && - function_exists('ob_gzhandler')) { + function_exists('ob_gzhandler') && + // Disable compression when a compressed sitemap might be delivered + // See https://bugs.dokuwiki.org/index.php?do=details&task_id=2576 + !($ACT == 'sitemap' && Sitemapper::sitemapIsCompressed())) { ob_start('ob_gzhandler'); } -- cgit v1.2.3 From 99e10b7f23d5d909db42434325a51a9c626fd8fb Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Fri, 24 Aug 2012 17:24:07 +0200 Subject: Always disable compression when sitemaps are delivered The class loader isn't available at that place in inc/init.php so the check if the sitemap is compressed didn't work. --- inc/init.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/init.php') diff --git a/inc/init.php b/inc/init.php index 4105225ea..3cafab986 100644 --- a/inc/init.php +++ b/inc/init.php @@ -133,9 +133,9 @@ global $ACT; if ($conf['gzip_output'] && !defined('DOKU_DISABLE_GZIP_OUTPUT') && function_exists('ob_gzhandler') && - // Disable compression when a compressed sitemap might be delivered + // Disable compression when a (compressed) sitemap might be delivered // See https://bugs.dokuwiki.org/index.php?do=details&task_id=2576 - !($ACT == 'sitemap' && Sitemapper::sitemapIsCompressed())) { + $ACT != 'sitemap') { ob_start('ob_gzhandler'); } -- cgit v1.2.3 From c114d4c4a0ef8fa3f244e09219868b02f6c01c67 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 26 Aug 2012 13:25:29 +0200 Subject: don't call set_magic_quotes_runtime if it doesn't exists FS#2583 this function was removed in PHP 5.4.0 --- inc/init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/init.php') diff --git a/inc/init.php b/inc/init.php index 3cafab986..9568d9b93 100644 --- a/inc/init.php +++ b/inc/init.php @@ -166,7 +166,7 @@ if (get_magic_quotes_gpc() && !defined('MAGIC_QUOTES_STRIPPED')) { @ini_set('magic_quotes_gpc', 0); define('MAGIC_QUOTES_STRIPPED',1); } -@set_magic_quotes_runtime(0); +if(function_exists('set_magic_quotes_runtime')) @set_magic_quotes_runtime(0); @ini_set('magic_quotes_sybase',0); // don't let cookies ever interfere with request vars -- cgit v1.2.3