From 8575354dfd25a90fdac496d49811716c742b2271 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Thu, 12 May 2022 15:19:14 +0200 Subject: [PATCH] Remove the obsolete stripping of the `s=` when handling the canonical URL --- wcfsetup/install/files/lib/page/AbstractPage.class.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/page/AbstractPage.class.php b/wcfsetup/install/files/lib/page/AbstractPage.class.php index a54f8724ea..47d409dc39 100644 --- a/wcfsetup/install/files/lib/page/AbstractPage.class.php +++ b/wcfsetup/install/files/lib/page/AbstractPage.class.php @@ -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); -- 2.20.1