Merge pull request #6292 from webbuilders-group/base-path-fix

BUGFIX: Fixed crash when BASE_PATH is set by assuming the location of Constants.php
This commit is contained in:
Daniel Hensby 2016-11-04 21:45:50 +00:00 committed by GitHub
commit d66c031244

View File

@ -188,10 +188,10 @@ if(!defined('BASE_PATH')) {
}
}
// Determine BASE_PATH by assuming that this file is framework/core/Core.php
// Determine BASE_PATH by assuming that this file is framework/src/Core/Constants.php
if(!defined('BASE_PATH')) {
// we can then determine the base path
$candidateBasePath = rtrim(dirname(dirname(dirname(__FILE__))), DIRECTORY_SEPARATOR);
$candidateBasePath = rtrim(dirname(dirname(dirname(dirname(__FILE__)))), 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
if($candidateBasePath == '') $candidateBasePath = DIRECTORY_SEPARATOR;