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
pull/304/head
Pavel Dvořák 2016-05-22 23:36:30 +02:00
parent bc45f53ba2
commit 34e6f9a157
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}