Remove the obsolete stripping of the `s=<sessionID>` when handling the canonical URL
authorTim Düsterhus <duesterhus@woltlab.com>
Thu, 12 May 2022 13:19:14 +0000 (15:19 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Thu, 12 May 2022 13:19:14 +0000 (15:19 +0200)
wcfsetup/install/files/lib/page/AbstractPage.class.php

index a54f8724eac37fecc235c8cba9516bd12e773bf0..47d409dc398514f28f036815ea2a39e700b40e5e 100644 (file)
@@ -269,12 +269,11 @@ abstract class AbstractPage implements IPage
 
         // check if current request URL matches the canonical URL
         if ($this->canonicalURL && (empty($_POST) || $this->forceCanonicalURL)) {
-            $canonicalURL = Url::parse(\preg_replace('~[?&]s=[a-f0-9]{40}~', '', $this->canonicalURL));
+            $canonicalURL = Url::parse($this->canonicalURL);
 
             // use $_SERVER['REQUEST_URI'] because it represents the URL used to access the site and not the internally rewritten one
             // IIS Rewrite-Module has a bug causing the REQUEST_URI to be ISO-encoded
             $requestURI = (!empty($_SERVER['UNENCODED_URL'])) ? $_SERVER['UNENCODED_URL'] : $_SERVER['REQUEST_URI'];
-            $requestURI = \preg_replace('~[?&]s=[a-f0-9]{40}~', '', $requestURI);
 
             if (!StringUtil::isUTF8($requestURI)) {
                 $requestURI = StringUtil::convertEncoding('ISO-8859-1', 'UTF-8', $requestURI);