Fix reloading exception log page losing filter parameters
authorMatthias Schmidt <gravatronics@live.com>
Sat, 9 Feb 2019 10:01:56 +0000 (11:01 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 9 Feb 2019 10:01:56 +0000 (11:01 +0100)
Close #2830

wcfsetup/install/files/lib/acp/page/ExceptionLogViewPage.class.php

index a6b0139ab98b55c6a96243fbc9645428ad273102..48f880a46d501117412f16660863492c29acf907 100644 (file)
@@ -5,6 +5,7 @@ use wcf\page\MultipleLinkPage;
 use wcf\system\event\EventHandler;
 use wcf\system\exception\IllegalLinkException;
 use wcf\system\Regex;
+use wcf\system\request\LinkHandler;
 use wcf\system\WCF;
 use wcf\util\DirectoryUtil;
 use wcf\util\JSON;
@@ -40,6 +41,11 @@ class ExceptionLogViewPage extends MultipleLinkPage {
         */
        public $exceptionID = '';
        
+       /**
+        * @inheritDoc
+        */
+       public $forceCanonicalURL = true;
+       
        /**
         * active logfile
         * @var string
@@ -66,6 +72,16 @@ class ExceptionLogViewPage extends MultipleLinkPage {
                
                if (isset($_REQUEST['exceptionID'])) $this->exceptionID = StringUtil::trim($_REQUEST['exceptionID']);
                if (isset($_REQUEST['logFile'])) $this->logFile = StringUtil::trim($_REQUEST['logFile']);
+               
+               $parameters = [];
+               if ($this->exceptionID !== '') {
+                       $parameters['exceptionID'] = $this->exceptionID;
+               }
+               else if ($this->logFile !== '') {
+                       $parameters['logFile'] = $this->logFile;
+               }
+               
+               $this->canonicalURL = LinkHandler::getInstance()->getControllerLink(self::class, $parameters);
        }
        
        /**