diff --git a/src/includes/constants.php b/src/includes/constants.php index 2cffccb7d..17b67166a 100644 --- a/src/includes/constants.php +++ b/src/includes/constants.php @@ -58,9 +58,10 @@ if (!defined('BASE_PATH')) { } } - // Determine BASE_PATH by assuming that this file is framework/src/Core/Constants.php - // we can then determine the base path - $candidateBasePath = rtrim(dirname(dirname(dirname(__DIR__))), DIRECTORY_SEPARATOR); + // Determine BASE_PATH by assuming that this file is vendor/silverstripe/framework/src/includes/constants.php + // we can then determine the base path + $candidateBasePath = rtrim(dirname(__DIR__, 5), DIRECTORY_SEPARATOR); + // We can't have an empty BASE_PATH. Making it / means that double-slashes occur in places but that's benign. // This likely only happens on chrooted environemnts return $candidateBasePath ?: DIRECTORY_SEPARATOR;