From f039270f8efdfe7a3d95a3fd80d1bf158dde05d5 Mon Sep 17 00:00:00 2001 From: Stricted Date: Wed, 20 Jul 2016 08:59:19 +0200 Subject: [PATCH] fix last commit --- lib/system/RequestHandler.class.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/system/RequestHandler.class.php b/lib/system/RequestHandler.class.php index f455894..54f076b 100644 --- a/lib/system/RequestHandler.class.php +++ b/lib/system/RequestHandler.class.php @@ -154,7 +154,7 @@ class RequestHandler extends SingletonFactory { } 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) { @@ -173,24 +173,26 @@ class RequestHandler extends SingletonFactory { if (!empty($params['id'])) { if (!empty($params['title'])) { - $url .= '/'.$params['id'].'-'.$params['title']; + $url .= '/' . $params['id'] . '-' . $params['title']; } else { - $url .= '/'.$params['id']; + $url .= '/' . $params['id']; } } 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 { - if (strpos($query, '/') === 0) { + if (strpos($query, '?') === 0) { $query = '&' . substr($query, 1); } else if (strpos($query, '&') !== 0) { -- 2.20.1