mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
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:
parent
5bd7662cb4
commit
8bd5349e42
@ -11,7 +11,7 @@ use SilverStripe\Assets\File;
|
|||||||
*/
|
*/
|
||||||
define('CMS_PATH', realpath(__DIR__));
|
define('CMS_PATH', realpath(__DIR__));
|
||||||
if(strpos(CMS_PATH, BASE_PATH) === 0) {
|
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 {
|
} else {
|
||||||
throw new Exception("Path error: CMS_PATH " . CMS_PATH . " not within BASE_PATH " . BASE_PATH);
|
throw new Exception("Path error: CMS_PATH " . CMS_PATH . " not within BASE_PATH " . BASE_PATH);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user