Skip to content

Commit

Permalink
Fix to allow ASSETS_DIR to be a subdirectory
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendan Halley committed Jan 30, 2017
1 parent 2f78f43 commit 10d9f90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/controllers/CMSFileAddController.php
Expand Up @@ -73,7 +73,7 @@ public function getEditForm($id = null, $fields = null) {

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
Expand Down

0 comments on commit 10d9f90

Please sign in to comment.