Fixed WCF::getRequestURI() returning garbage w/ active SEO option
authorAlexander Ebert <ebert@woltlab.com>
Tue, 10 Mar 2015 11:26:35 +0000 (12:26 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 10 Mar 2015 11:26:35 +0000 (12:26 +0100)
wcfsetup/install/files/lib/system/WCF.class.php

index 2237973399d5036d4c9b17b622ab06f209d38570..d2a6fed79433cc5a6ec304478675329f592592ce 100644 (file)
@@ -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;
                }
        }