Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX BASE_PATH fallback assumed wrong file location #9977

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/includes/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@
}
}

// 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;
Expand Down