summaryrefslogtreecommitdiff
path: root/inc/Sitemapper.php
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2012-08-24 14:16:30 +0200
committerMichael Hamann <michael@content-space.de>2012-08-24 16:50:07 +0200
commit65f6e7d681429606c80d257b157e2af13f11e67a (patch)
treec2c7e56a083785d349e6dba62718ec0e8282cd2b /inc/Sitemapper.php
parent64273335d1bae12b2fe7d9664e1665d6e69d47af (diff)
downloadrpg-65f6e7d681429606c80d257b157e2af13f11e67a.tar.gz
rpg-65f6e7d681429606c80d257b157e2af13f11e67a.tar.bz2
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.
Diffstat (limited to 'inc/Sitemapper.php')
-rw-r--r--inc/Sitemapper.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/inc/Sitemapper.php b/inc/Sitemapper.php
index bbea73b52..1315ed448 100644
--- a/inc/Sitemapper.php
+++ b/inc/Sitemapper.php
@@ -100,7 +100,7 @@ class Sitemapper {
global $conf;
$sitemap = $conf['cachedir'].'/sitemap.xml';
- if($conf['compression'] === 'bz2' || $conf['compression'] === 'gz'){
+ if (self::sitemapIsCompressed()) {
$sitemap .= '.gz';
}
@@ -108,6 +108,16 @@ class Sitemapper {
}
/**
+ * Helper function for checking if the sitemap is compressed
+ *
+ * @return bool If the sitemap file is compressed
+ */
+ public static function sitemapIsCompressed() {
+ global $conf;
+ return $conf['compression'] === 'bz2' || $conf['compression'] === 'gz';
+ }
+
+ /**
* Pings search engines with the sitemap url. Plugins can add or remove
* urls to ping using the SITEMAP_PING event.
*