From: Stricted Date: Wed, 20 Jul 2016 07:31:28 +0000 (+0200) Subject: fix double slash in url X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=082934b8e33b6d6654dc8d7ad585b3c6b892793d;p=GitHub%2FStricted%2FDomain-Control-Panel.git fix double slash in url --- diff --git a/lib/system/RequestHandler.class.php b/lib/system/RequestHandler.class.php index 98e3fa2..13c2901 100644 --- a/lib/system/RequestHandler.class.php +++ b/lib/system/RequestHandler.class.php @@ -150,7 +150,8 @@ class RequestHandler extends SingletonFactory { $protocol = 'https://'; } - return $protocol . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . '/'; + $dirname = dirname($_SERVER['PHP_SELF']); + return $protocol . $_SERVER['HTTP_HOST'] . ($dirname == '/' ? $dirname : $dirname . '/'); } public function getLink (array $params = [], $query = '') {