diff options
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/helper.php b/lib/helper.php index 4beef4d..91583d1 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -86,11 +86,20 @@ function baseurl() $base = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) ? 'https://' : 'http://'; $base .= $_SERVER['HTTP_HOST']; - $base .= rtrim(dirname($_SERVER['SCRIPT_NAME']), '/').'/'; + $base .= forceslash(dirname($_SERVER['SCRIPT_NAME'])); return $base; } +function forceslash($url) +{ + $url = rtrim($url, '/'); + if(strlen($url) > 0) + $url .= '/'; + + return $url; +} + function strtoduration($str) { $parts = explode(':', $str); |