fix last commit
authorStricted <info@stricted.net>
Wed, 20 Jul 2016 06:59:19 +0000 (08:59 +0200)
committerStricted <info@stricted.net>
Wed, 20 Jul 2016 06:59:19 +0000 (08:59 +0200)
lib/system/RequestHandler.class.php

index f4558943c4ffa3c60842496f66e1f370a07c0de9..54f076b7feff74dd922c3b8137585790d69ffe46 100644 (file)
@@ -154,7 +154,7 @@ class RequestHandler extends SingletonFactory {
        }
        
        public function getLink (array $params = [], $query = '') {
        }
        
        public function getLink (array $params = [], $query = '') {
-               $path_info = true; // TODO: add config constant for that
+               $path_info = false; // TODO: add config constant for that
                
                $url = $this->getBaseUrl() . 'index.php';
                if ($path_info) {
                
                $url = $this->getBaseUrl() . 'index.php';
                if ($path_info) {
@@ -173,24 +173,26 @@ class RequestHandler extends SingletonFactory {
                
                if (!empty($params['id'])) {
                        if (!empty($params['title'])) {
                
                if (!empty($params['id'])) {
                        if (!empty($params['title'])) {
-                               $url .= '/'.$params['id'].'-'.$params['title'];
+                               $url .= '/' . $params['id'] . '-' . $params['title'];
                        }
                        else {
                        }
                        else {
-                               $url .= '/'.$params['id'];
+                               $url .= '/' . $params['id'];
                        }
                }
                
                if (!empty($query)) {
                        if ($path_info) {
                                if (strpos($query, '&') === 0) {
                        }
                }
                
                if (!empty($query)) {
                        if ($path_info) {
                                if (strpos($query, '&') === 0) {
-                                       $query = '/' . substr($query, 1);
+                                       $query = '?' . substr($query, 1);
                                }
                                }
-                               else if (strpos($query, '/') !== 0) {
-                                       $query = '/' . $query;
+                               else if (strpos($query, '?') !== 0) {
+                                       $query = '?' . $query;
                                }
                                }
+                               
+                               $query = '/' . $query; 
                        }
                        else {
                        }
                        else {
-                               if (strpos($query, '/') === 0) {
+                               if (strpos($query, '?') === 0) {
                                        $query = '&' . substr($query, 1);
                                }
                                else if (strpos($query, '&') !== 0) {
                                        $query = '&' . substr($query, 1);
                                }
                                else if (strpos($query, '&') !== 0) {