Fix SS_BASE_URL logic when undefined and docroot without public folder

This commit is contained in:
Michal Kleiner 2020-04-10 15:06:14 +12:00
parent b6512edec8
commit ab87bdc044
No known key found for this signature in database
GPG Key ID: CFCE9D1A56C919C0

View File

@ -148,9 +148,9 @@ if (!defined('BASE_URL')) {
}
$requestURI = $_SERVER['REQUEST_URI'];
// Check if /base/public or /base are in the request
// Check if /base/public or /base are in the request (delimited by /)
foreach ([$baseURL, dirname($baseURL)] as $candidate) {
if (stripos($requestURI, $candidate) === 0) {
if (stripos($requestURI, rtrim($candidate, '/') . '/') === 0) {
return $candidate;
}
}