mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
parent
2c34af72e1
commit
1b087221d2
@ -82,8 +82,8 @@ if (!defined('BASE_URL')) {
|
||||
$urlSegmentToRemove = substr($path, strlen(BASE_PATH));
|
||||
if (substr($_SERVER['SCRIPT_NAME'], -strlen($urlSegmentToRemove)) == $urlSegmentToRemove) {
|
||||
$baseURL = substr($_SERVER['SCRIPT_NAME'], 0, -strlen($urlSegmentToRemove));
|
||||
// Normalise slashes to '/' and rtrim('/')
|
||||
return rtrim(str_replace('\\', '/', $baseURL), '/');
|
||||
// ltrim('.'), normalise slashes to '/', and rtrim('/')
|
||||
return rtrim(str_replace('\\', '/', ltrim($baseURL, '.')), '/');
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user