From c83cbb14ab5393d9e2c1775a06e537c647fca608 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sun, 30 Mar 2014 23:16:11 +0200 Subject: [PATCH] Fixed error in url() function Sometimes url() function produced URL with unnecessary slash, eg. `http://dalerium.net//register.php` - that's fixed. --- engine/function/general.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/function/general.php b/engine/function/general.php index d7efbaf..05092a5 100644 --- a/engine/function/general.php +++ b/engine/function/general.php @@ -94,7 +94,7 @@ function url($path = false) { $domain = $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != 80 ? ':' . $_SERVER['SERVER_PORT'] : null); $folder = dirname($_SERVER['SCRIPT_NAME']); - return $protocol . $domain . $folder . '/' . $path; + return $protocol . $domain . ($folder == '/' ? '' : $folder) . '/' . $path; } function getCache() {