From f15c948f788c6341433b02ca528e420993a2970b Mon Sep 17 00:00:00 2001 From: Stricted Date: Sun, 17 Jul 2016 08:36:23 +0200 Subject: [PATCH] remove debug code and fix route detection --- lib/system/RequestHandler.class.php | 2 -- lib/system/route/Request.class.php | 9 ++++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/system/RequestHandler.class.php b/lib/system/RequestHandler.class.php index 724a5df..bedc94f 100644 --- a/lib/system/RequestHandler.class.php +++ b/lib/system/RequestHandler.class.php @@ -48,7 +48,6 @@ class RequestHandler extends SingletonFactory { public function handle () { $match = $this->router->match(new Request()); - var_dump($this->router->getRoutes()); if ($match !== null) { foreach ($match->getParams() as $key => $value) { $_GET[$key] = $value; @@ -58,7 +57,6 @@ class RequestHandler extends SingletonFactory { $className = $match->getParam("controller"); if (!User::isLoggedIn() && $className != 'dns\page\LoginPage' && $className != 'dns\page\ApiPage') { - echo $className; DNS::getTPL()->display('login.tpl'); exit; } diff --git a/lib/system/route/Request.class.php b/lib/system/route/Request.class.php index 7ab4912..ac40533 100644 --- a/lib/system/route/Request.class.php +++ b/lib/system/route/Request.class.php @@ -8,6 +8,13 @@ class Request extends BaseRequest { } public function getPath() { - return $_SERVER['QUERY_STRING']; + $queryString = $_SERVER['QUERY_STRING']; + + if (strpos($queryString, '&') !== false) { + $pos = strpos($queryString, '&'); + $queryString = substr($queryString, 0, $pos); + } + echo $queryString; + return $queryString; } } -- 2.20.1