From 5611190d39048af86ca7bd84be68a2af04786912 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 11 Aug 2014 00:35:55 +0200 Subject: [PATCH] Simplified route parsing --- .../lib/system/request/RouteHandler.class.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/wcfsetup/install/files/lib/system/request/RouteHandler.class.php b/wcfsetup/install/files/lib/system/request/RouteHandler.class.php index 47df34ce82..741a1de0fc 100644 --- a/wcfsetup/install/files/lib/system/request/RouteHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RouteHandler.class.php @@ -291,17 +291,12 @@ class RouteHandler extends SingletonFactory { else { // WCF 2.1: ?Foo/Bar/ if (!empty($_SERVER['QUERY_STRING'])) { - $pos = mb_strpos($_SERVER['QUERY_STRING'], '&'); - $route = ''; - if ($pos === false) { - $route = $_SERVER['QUERY_STRING']; - } - else { - $route = mb_substr($_SERVER['QUERY_STRING'], 0, $pos); - } - - if (mb_strpos($route, '=') === false) { - self::$pathInfo = $route; + parse_str($_SERVER['QUERY_STRING'], $parts); + foreach ($parts as $key => $value) { + if ($value === '') { + self::$pathInfo = $key; + break; + } } } } -- 2.20.1