remove debug code and fix route detection
authorStricted <info@stricted.net>
Sun, 17 Jul 2016 06:36:23 +0000 (08:36 +0200)
committerStricted <info@stricted.net>
Sun, 17 Jul 2016 06:36:23 +0000 (08:36 +0200)
lib/system/RequestHandler.class.php
lib/system/route/Request.class.php

index 724a5df74518153da5565f96ea18876fdf1a1187..bedc94fd91f8a1945216d96414c9fbf2d58202bf 100644 (file)
@@ -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;
                        }
index 7ab4912b261bf29211be5e3a46aef0f0c0acc68e..ac40533cb770b4e33d457de0bb136644ac7952c3 100644 (file)
@@ -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;
        }
 }