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('/')