mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Folder::findOrMake() will create the assets/ folder if it's missing
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99638 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ed7b0c4a8c
commit
6e4ab94b8c
@ -12,6 +12,9 @@ class Folder extends File {
|
||||
* @param $folderPath string Absolute or relative path to the file
|
||||
*/
|
||||
static function findOrMake($folderPath) {
|
||||
// Create assets directory, if it is missing
|
||||
if(!file_exists(ASSETS_PATH)) mkdir(ASSETS_PATH,Filesystem::$folder_create_mask);
|
||||
|
||||
$folderPath = trim(Director::makeRelative($folderPath));
|
||||
// replace leading and trailing slashes
|
||||
$folderPath = preg_replace('/^\/?(.*)\/?$/', '$1', $folderPath);
|
||||
|
Loading…
Reference in New Issue
Block a user