From 8f7b588144487185ef35fabced8c9d6682e817cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ya=C4=9F=C4=B1zhan?= Date: Sat, 19 Nov 2022 22:46:27 +0300 Subject: [PATCH] Fixed the extra question mark --- src/bb-library/Box/Url.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bb-library/Box/Url.php b/src/bb-library/Box/Url.php index 2d148806b..5cbe5b38c 100644 --- a/src/bb-library/Box/Url.php +++ b/src/bb-library/Box/Url.php @@ -47,17 +47,17 @@ class Box_Url implements Box\InjectionAwareInterface public function link($uri = null, $params = array()) { $uri = trim($uri, '/'); - $link =$this->baseUri .'index.php?_url=/' . $uri; + $link = BB_SEF_URLS ? $this->baseUri . $uri : $this->baseUri .'index.php?_url=/' . $uri; if(BB_SEF_URLS) { - $link = $this->baseUri . $uri; if (!empty($params)){ - $link .= '?'; + $link .= '?' . http_build_query($params); + } + } else { + if (!empty($params)){ + $link .= '&' . http_build_query($params); } } - if(!empty($params)) { - $link .= '&' . http_build_query($params); - } return $link; } @@ -68,4 +68,4 @@ class Box_Url implements Box\InjectionAwareInterface $uri = $prefix . '/' . $uri; return $this->link($uri, $params); } -} \ No newline at end of file +}