mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 06:05:56 +00:00
Fix to allow ASSETS_DIR to be a subdirectory
This commit is contained in:
parent
2f78f43273
commit
10d9f9080b
@ -73,7 +73,7 @@ class CMSFileAddController extends LeftAndMain {
|
|||||||
|
|
||||||
if($folder->exists() && $folder->getFilename()) {
|
if($folder->exists() && $folder->getFilename()) {
|
||||||
// The Upload class expects a folder relative *within* assets/
|
// The Upload class expects a folder relative *within* assets/
|
||||||
$path = preg_replace('/^' . ASSETS_DIR . '\//', '', $folder->getFilename());
|
$path = preg_replace('/^' . preg_quote(ASSETS_DIR, '/') . '\//', '', $folder->getFilename());
|
||||||
$uploadField->setFolderName($path);
|
$uploadField->setFolderName($path);
|
||||||
} else {
|
} else {
|
||||||
$uploadField->setFolderName('/'); // root of the assets
|
$uploadField->setFolderName('/'); // root of the assets
|
||||||
|
Loading…
x
Reference in New Issue
Block a user