Work-around for services like GitHub messing up the query string
authorAlexander Ebert <ebert@woltlab.com>
Thu, 2 Jul 2015 13:48:40 +0000 (15:48 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Thu, 2 Jul 2015 13:48:40 +0000 (15:48 +0200)
wcfsetup/install/files/lib/system/request/RouteHandler.class.php

index c150e7456fbda4aeeeca209c95cf3c0191e52e0e..c6ee9d9c7b8a5b7f3be49b6eda488c47f1779e9e 100644 (file)
@@ -290,6 +290,12 @@ class RouteHandler extends SingletonFactory {
                                        $components = explode('&', $_SERVER['QUERY_STRING']);
                                        for ($i = 0, $length = count($components); $i < $length; $i++) {
                                                $component = $components[$i];
+                                               
+                                               $pos = mb_strpos($component, '=');
+                                               if ($pos !== false && $pos + 1 === mb_strlen($component)) {
+                                                       $component = mb_substr($component, 0, -1);
+                                               }
+                                               
                                                if (mb_strpos($component, '=') === false) {
                                                        self::$pathInfo = urldecode($component);
                                                        break;