Skip to content
Permalink
Browse files

BUG Fix BASE_URL on CLI

Fixes #7256
  • Loading branch information
Damian Mooyman
Damian Mooyman committed Aug 23, 2017
1 parent 2c34af7 commit 1b087221d221523c76755e5a684f5b408c306ef7
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/includes/constants.php
@@ -82,8 +82,8 @@
$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, '.')), '/');
}
}

0 comments on commit 1b08722

Please sign in to comment.
You can’t perform that action at this time.