mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #9460 from chrometoasters/pulls/fix-9459-public-path
Fix SS_BASE_URL logic when undefined and docroot without public folder
This commit is contained in:
commit
9aba767e36
@ -148,9 +148,9 @@ if (!defined('BASE_URL')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$requestURI = $_SERVER['REQUEST_URI'];
|
$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) {
|
foreach ([$baseURL, dirname($baseURL)] as $candidate) {
|
||||||
if (stripos($requestURI, $candidate) === 0) {
|
if (stripos($requestURI, rtrim($candidate, '/') . '/') === 0) {
|
||||||
return $candidate;
|
return $candidate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user