From 6c6716beec569d3a0faac4be15bacc6cd8a631b5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Sat, 2 Mar 2019 20:32:29 +0100 Subject: [PATCH] Add canonical URL for Trophy(List)?Page --- wcfsetup/install/files/lib/page/TrophyListPage.class.php | 5 +++++ wcfsetup/install/files/lib/page/TrophyPage.class.php | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/wcfsetup/install/files/lib/page/TrophyListPage.class.php b/wcfsetup/install/files/lib/page/TrophyListPage.class.php index 0c86378a4d..89c0046fc5 100644 --- a/wcfsetup/install/files/lib/page/TrophyListPage.class.php +++ b/wcfsetup/install/files/lib/page/TrophyListPage.class.php @@ -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; /** @@ -79,6 +80,10 @@ class TrophyListPage extends MultipleLinkPage { if (!$this->category->isAccessible()) { throw new PermissionDeniedException(); } + + $this->canonicalURL = LinkHandler::getInstance()->getLink('TrophyList', [ + 'object' => $this->category + ], ($this->pageNo > 1 ? 'pageNo=' . $this->pageNo : '')); } /** diff --git a/wcfsetup/install/files/lib/page/TrophyPage.class.php b/wcfsetup/install/files/lib/page/TrophyPage.class.php index 1f24c124e6..02b8ae80cb 100644 --- a/wcfsetup/install/files/lib/page/TrophyPage.class.php +++ b/wcfsetup/install/files/lib/page/TrophyPage.class.php @@ -10,6 +10,7 @@ use wcf\system\database\util\PreparedStatementConditionBuilder; use wcf\system\exception\IllegalLinkException; use wcf\system\exception\PermissionDeniedException; use wcf\system\page\PageLocationManager; +use wcf\system\request\LinkHandler; use wcf\system\WCF; /** @@ -66,6 +67,9 @@ class TrophyPage extends MultipleLinkPage { */ public $trophy; + /** + * @inheritDoc + */ public function readData() { parent::readData(); @@ -88,6 +92,10 @@ class TrophyPage extends MultipleLinkPage { if ($this->trophy->isDisabled()) { throw new PermissionDeniedException(); } + + $this->canonicalURL = LinkHandler::getInstance()->getLink('Trophy', [ + 'object' => $this->trophy + ], ($this->pageNo > 1 ? 'pageNo=' . $this->pageNo : '')); } /** -- 2.20.1