BUGFIX: Fixed issue on windows where the CMS_DIR constant would be set containing a backslash causing a crash in the cms

This commit is contained in:
UndefinedOffset 2016-11-04 13:28:46 -03:00
parent 5bd7662cb4
commit 8bd5349e42

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);
}