Fix closing closed temp sitemap files
authorJoshua Rüsweg <josh@bastelstu.be>
Thu, 10 Aug 2017 11:59:34 +0000 (13:59 +0200)
committerJoshua Rüsweg <josh@bastelstu.be>
Thu, 10 Aug 2017 12:00:55 +0000 (14:00 +0200)
See #2286

wcfsetup/install/files/lib/system/worker/SitemapRebuildWorker.class.php

index dfd36dfbc79156585952220516bad2b63f2aaaa0..a5d118b58369a1e8c9c3ef9c207c746c93ce4af9 100755 (executable)
@@ -166,10 +166,9 @@ class SitemapRebuildWorker extends AbstractWorker {
                        
                        // finish sitemap
                        if (count($objectList) < $this->limit) {
-                               $closeFile = true;
                                if ($this->workerData['dataCount'] > 0) {
                                        $this->finishSitemap($this->sitemapObjects[$this->workerData['sitemap']]->objectType . '.xml');
-                                       $closeFile = false;
+                                       $this->generateTmpFile(false);
                                }
                                
                                // increment data
@@ -179,8 +178,6 @@ class SitemapRebuildWorker extends AbstractWorker {
                                
                                if (count($this->sitemapObjects) <= $this->workerData['sitemap']) {
                                        $this->writeIndexFile();
-                               } else {
-                                       $this->generateTmpFile($closeFile);
                                }
                        }