From: Tim Düsterhus Date: Thu, 12 May 2022 13:19:14 +0000 (+0200) Subject: Remove the obsolete stripping of the `s=` when handling the canonical URL X-Git-Tag: 6.0.0_Alpha_1~1316^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8575354dfd25a90fdac496d49811716c742b2271;p=GitHub%2FWoltLab%2FWCF.git Remove the obsolete stripping of the `s=` when handling the canonical URL --- 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);