From bdfa20bbbb60903a9582c0ddf0cbc54c2f5eee72 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Wed, 3 Jan 2018 17:32:14 +0100 Subject: [PATCH] Prevent outdated sitemap index file If we have no active sitemap objects, the sitemap index file were not updated and has an outdated value. --- .../files/lib/system/worker/SitemapRebuildWorker.class.php | 5 +++++ 1 file changed, 5 insertions(+) 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(); -- 2.20.1