Add canonical URL for CategoryTrophyListPage
authorJoshua Rüsweg <josh@bastelstu.be>
Sat, 2 Mar 2019 19:43:11 +0000 (20:43 +0100)
committerJoshua Rüsweg <josh@bastelstu.be>
Sat, 2 Mar 2019 19:43:11 +0000 (20:43 +0100)
wcfsetup/install/files/lib/page/CategoryTrophyListPage.class.php

index 2396e821205a9021e482bcc8e73366149cd77568..b2b129668e0efc4aa94e287abaf23671b57f41db 100644 (file)
@@ -5,6 +5,7 @@ use wcf\data\trophy\category\TrophyCategoryCache;
 use wcf\data\trophy\TrophyList;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\exception\PermissionDeniedException;
+use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
 
 /**
@@ -48,6 +49,10 @@ class CategoryTrophyListPage extends TrophyListPage {
                if (!$this->category->isAccessible()) {
                        throw new PermissionDeniedException();
                }
+               
+               $this->canonicalURL = LinkHandler::getInstance()->getLink('CategoryTrophyList', [
+                       'object' => $this->category
+               ], ($this->pageNo > 1 ? 'pageNo=' . $this->pageNo : ''));
        }
        
        /**