From 4f86656e587a7bb62297c0e706decc214c402f68 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 10 Mar 2015 12:26:35 +0100 Subject: [PATCH] Fixed WCF::getRequestURI() returning garbage w/ active SEO option --- wcfsetup/install/files/lib/system/WCF.class.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index 2237973399..d2a6fed794 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -764,12 +764,10 @@ class WCF { return $baseHref . $path; } else { - $queryString = $_SERVER['QUERY_STRING']; - if (!StringUtil::isUTF8($queryString)) { - $queryString = StringUtil::convertEncoding('ISO-8859-1', 'UTF-8', $queryString); - } + $url = preg_replace('~^(https?://[^/]+)(?:/.*)?$~', '$1', self::getTPL()->get('baseHref')); + $url .= $_SERVER['REQUEST_URI']; - return self::getTPL()->get('baseHref') . ($queryString ? '?' . $queryString : ''); + return $url; } } -- 2.20.1