From 0467708c8c13363cf2df5dbd5c459e456d5867dc Mon Sep 17 00:00:00 2001 From: Bzucko Date: Fri, 26 Jan 2024 03:53:32 +0100 Subject: [PATCH] OS independent directory separator Comparison with just '/' was causing double '//' after host name on windows OS. --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 1fa5736..5f2fcf1 100644 --- a/index.php +++ b/index.php @@ -2937,7 +2937,7 @@ public static function url(string $location = ''): string return ($showHttps ? 'https' : 'http') . '://' . ($_SERVER['HTTP_HOST'] ?? $_SERVER['SERVER_NAME']) . ($_SERVER['HTTP_HOST'] ? '' : $serverPort) - . ((dirname($_SERVER['SCRIPT_NAME']) === '/') ? '' : dirname($_SERVER['SCRIPT_NAME'])) + . ((dirname($_SERVER['SCRIPT_NAME']) === DIRECTORY_SEPARATOR) ? '' : dirname($_SERVER['SCRIPT_NAME'])) . '/' . $location; }