From 10d9f9080b6cc6c909abdae796e8ce944036ccc2 Mon Sep 17 00:00:00 2001 From: Brendan Halley Date: Tue, 31 Jan 2017 09:46:14 +1100 Subject: [PATCH] Fix to allow ASSETS_DIR to be a subdirectory --- code/controllers/CMSFileAddController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/controllers/CMSFileAddController.php b/code/controllers/CMSFileAddController.php index c3fb382e..e87c0e5a 100644 --- a/code/controllers/CMSFileAddController.php +++ b/code/controllers/CMSFileAddController.php @@ -73,7 +73,7 @@ class CMSFileAddController extends LeftAndMain { if($folder->exists() && $folder->getFilename()) { // 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); } else { $uploadField->setFolderName('/'); // root of the assets