From: Joshua Rüsweg Date: Wed, 3 Jan 2018 16:32:14 +0000 (+0100) Subject: Prevent outdated sitemap index file X-Git-Tag: 3.1.0_RC_1~17 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bdfa20bbbb60903a9582c0ddf0cbc54c2f5eee72;p=GitHub%2FWoltLab%2FWCF.git Prevent outdated sitemap index file If we have no active sitemap objects, the sitemap index file were not updated and has an outdated value. --- diff --git a/wcfsetup/install/files/lib/system/worker/SitemapRebuildWorker.class.php b/wcfsetup/install/files/lib/system/worker/SitemapRebuildWorker.class.php index 289092ec78..4f664a1767 100755 --- a/wcfsetup/install/files/lib/system/worker/SitemapRebuildWorker.class.php +++ b/wcfsetup/install/files/lib/system/worker/SitemapRebuildWorker.class.php @@ -122,6 +122,11 @@ class SitemapRebuildWorker extends AbstractWorker { $this->storeWorkerData(); } + // write sitemap index file if we have no active sitemap objects to prevent an outdated index file + if (empty($this->sitemapObjects) && $this->loopCount == 0) { + $this->writeIndexFile(); + } + // check whether we should rebuild it if (!isset($this->parameters['forceRebuild']) || !$this->parameters['forceRebuild'] && !$this->workerData['finished']) { $this->checkCache();