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/actions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/actions.php') diff --git a/inc/actions.php b/inc/actions.php index 62b0e1800..88576e1dc 100644 --- a/inc/actions.php +++ b/inc/actions.php @@ -637,7 +637,7 @@ function act_sitemap($act) { } $sitemap = Sitemapper::getFilePath(); - if(strrchr($sitemap, '.') === '.gz'){ + if (Sitemapper::sitemapIsCompressed()) { $mime = 'application/x-gzip'; }else{ $mime = 'application/xml; charset=utf-8'; -- cgit v1.2.3 From c8b076b15853f1f79ea87f5f493c7b726cdca0a6 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Fri, 24 Aug 2012 14:23:36 +0200 Subject: Add PHPDoc comments, type hints and ignore return value of act_sitemap() --- inc/actions.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'inc/actions.php') diff --git a/inc/actions.php b/inc/actions.php index 88576e1dc..f65b47451 100644 --- a/inc/actions.php +++ b/inc/actions.php @@ -64,7 +64,7 @@ function act_dispatch(){ //sitemap if ($ACT == 'sitemap'){ - $ACT = act_sitemap($ACT); + act_sitemap($ACT); } //register @@ -137,6 +137,7 @@ function act_dispatch(){ if (in_array($page, $pluginlist)) { // attempt to load the plugin if ($plugin =& plugin_load('admin',$page) !== null){ + /** @var DokuWiki_Admin_Plugin $plugin */ if($plugin->forAdminOnly() && !$INFO['isadmin']){ // a manager tried to load a plugin that's for admins only $INPUT->remove('page'); @@ -177,6 +178,11 @@ function act_dispatch(){ // in function tpl_content() } +/** + * Send the given headers using header() + * + * @param array $headers The headers that shall be sent + */ function act_sendheaders($headers) { foreach ($headers as $hdr) header($hdr); } @@ -437,6 +443,11 @@ function act_redirect($id,$preact){ trigger_event('ACTION_SHOW_REDIRECT',$opts,'act_redirect_execute'); } +/** + * Execute the redirect + * + * @param array $opts id and fragment for the redirect + */ function act_redirect_execute($opts){ $go = wl($opts['id'],'',true); if(isset($opts['fragment'])) $go .= '#'.$opts['fragment']; -- cgit v1.2.3