[icinga-checkins] icinga.org: icingaweb2/master: Url: Remove "/" in front of path if the url has a user parameter

git at icinga.org git at icinga.org
Thu Oct 20 09:31:14 CEST 2016


Module: icingaweb2
Branch: master
Commit: 1c5535146069ae249d07483b14a5d6865f3f405d
URL:    https://git.icinga.org/?p=icingaweb2.git;a=commit;h=1c5535146069ae249d07483b14a5d6865f3f405d

Author: Noah Hilverling <noah.hilverling at netways.de>
Date:   Tue Oct 18 16:07:13 2016 +0200

Url: Remove "/" in front of path if the url has a user parameter

refs #12133

---

 library/Icinga/Web/Url.php |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/library/Icinga/Web/Url.php b/library/Icinga/Web/Url.php
index 4749b44..cefbdf5 100644
--- a/library/Icinga/Web/Url.php
+++ b/library/Icinga/Web/Url.php
@@ -189,7 +189,7 @@ class Url
         if (isset($urlParts['path'])) {
             $urlPath = $urlParts['path'];
             if ($urlPath && $urlPath[0] === '/') {
-                if ($urlObject->isExternal()) {
+                if ($urlObject->isExternal() || isset($urlParts['user'])) {
                     $urlPath = substr($urlPath, 1);
                 } else {
                     $requestBaseUrl = $request->getBaseUrl();
@@ -198,12 +198,12 @@ class Url
                         $urlObject->setBasePath($requestBaseUrl);
                     }
                 }
-            } elseif (!$urlObject->isExternal()) {
+            } elseif (! $urlObject->isExternal()) {
                 $urlObject->setBasePath($request->getBaseUrl());
             }
 
             $urlObject->setPath($urlPath);
-        } elseif (!$urlObject->isExternal()) {
+        } elseif (! $urlObject->isExternal()) {
             $urlObject->setBasePath($request->getBaseUrl());
         }
 



More information about the icinga-checkins mailing list