From 50667bf6c3867697b4d5f80aa3a6c8f7c36ae26c Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 14 Apr 2010 04:42:59 +0000 Subject: [PATCH] BUGFIX: Folder::findOrMake() will create the assets/ folder if it's missing (from r99638) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102872 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- filesystem/Folder.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/filesystem/Folder.php b/filesystem/Folder.php index 345eacbdb..8b626c032 100755 --- a/filesystem/Folder.php +++ b/filesystem/Folder.php @@ -48,6 +48,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);