use MessageUtil::stripCrap() instead of an own implementation
authorJoshua Rüsweg <josh@bastelstu.be>
Fri, 9 Jun 2017 09:50:16 +0000 (11:50 +0200)
committerJoshua Rüsweg <josh@bastelstu.be>
Fri, 9 Jun 2017 09:50:16 +0000 (11:50 +0200)
wcfsetup/install/files/lib/system/worker/SitemapRebuildWorker.class.php

index 02359ac7c3e7449d9c9c0366a5b2aa59034ecb83..0937a39ac7aed9d14d921fa980d741950927cccb 100755 (executable)
@@ -10,6 +10,7 @@ use wcf\system\request\LinkHandler;
 use wcf\system\Regex;
 use wcf\system\WCF;
 use wcf\util\FileUtil;
+use wcf\util\MessageUtil;
 
 /**
  * Worker implementation for rebuilding all sitemaps.
@@ -132,7 +133,7 @@ class SitemapRebuildWorker extends AbstractWorker {
                        if ($sitemapObject->canView($object)) {
                                $this->file->write(WCF::getTPL()->fetch('sitemapEntry', 'wcf', [
                                        // strip session links
-                                       'link' => Regex::compile('(?<=\?|&)([st]=[a-f0-9]{40}|at=\d+-[a-f0-9]{40})')->replace($link, ''),
+                                       'link' => MessageUtil::stripCrap($link),
                                        'lastModifiedTime' => $lastModifiedTime,
                                        'priority' => $this->sitemapObjects[$this->workerData['sitemap']]->priority,
                                        'changeFreq' => $this->sitemapObjects[$this->workerData['sitemap']]->changeFreq