From 7ff707df7388c5c8d62784d4cf87c98036958a53 Mon Sep 17 00:00:00 2001 From: UndefinedOffset Date: Thu, 12 Oct 2017 10:54:27 -0300 Subject: [PATCH] BUGFIX: Fixed issue on windows where the BASE_URL constant would get set wrong if the site was in a sub-folder of the web root --- src/includes/constants.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/includes/constants.php b/src/includes/constants.php index e413532d1..669830501 100644 --- a/src/includes/constants.php +++ b/src/includes/constants.php @@ -100,7 +100,7 @@ if (!defined('BASE_URL')) { // This tends not to work on CLI $path = realpath($_SERVER['SCRIPT_FILENAME']); if (substr($path, 0, strlen(BASE_PATH)) == BASE_PATH) { - $urlSegmentToRemove = substr($path, strlen(BASE_PATH)); + $urlSegmentToRemove = str_replace('\\', '/', substr($path, strlen(BASE_PATH))); if (substr($_SERVER['SCRIPT_NAME'], -strlen($urlSegmentToRemove)) == $urlSegmentToRemove) { $baseURL = substr($_SERVER['SCRIPT_NAME'], 0, -strlen($urlSegmentToRemove)); // ltrim('.'), normalise slashes to '/', and rtrim('/')