From 34e6f9a15790f64761bd0b58427861417bb9f1fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Dvo=C5=99=C3=A1k?= Date: Sun, 22 May 2016 23:36:30 +0200 Subject: [PATCH] Issue #212 Setting Defaults for Pushover - bug fix - duplicate slash in the URL if the URL domain second or third order and the application is not in another folder --- src/includes/functions.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/includes/functions.inc.php b/src/includes/functions.inc.php index 45786561..f661fee4 100644 --- a/src/includes/functions.inc.php +++ b/src/includes/functions.inc.php @@ -508,7 +508,10 @@ function psm_build_url($params = array(), $urlencode = true, $htmlentities = tru $url = ($_SERVER['SERVER_PORT'] == 443 ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST']; // on Windows, dirname() adds both back- and forward slashes (http://php.net/dirname). // for urls, we only want the forward slashes. - $url .= dirname($_SERVER['SCRIPT_NAME']) . '/'; + $url .= dirname($_SERVER['SCRIPT_NAME']); + if (dirname($_SERVER['SCRIPT_NAME']) != '/') { + $url .= '/'; + } $url = str_replace('\\', '', $url); }