Merge pull request #1677 from webbuilders-group/windows-cms-dir-fix

BUGFIX: Fixed issue on windows where the CMS_DIR constant would be set containing a backslash
This commit is contained in:
Daniel Hensby 2016-11-04 21:47:09 +00:00 committed by GitHub
commit 510ea8bb6f
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@ use SilverStripe\Assets\File;
*/
define('CMS_PATH', realpath(__DIR__));
if(strpos(CMS_PATH, BASE_PATH) === 0) {
define('CMS_DIR', trim(substr(CMS_PATH, strlen(BASE_PATH)), '/'));
define('CMS_DIR', trim(substr(CMS_PATH, strlen(BASE_PATH)), DIRECTORY_SEPARATOR));
} else {
throw new Exception("Path error: CMS_PATH " . CMS_PATH . " not within BASE_PATH " . BASE_PATH);
}