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:
Sam Minnee 2010-02-23 00:11:15 +00:00
parent ed7b0c4a8c
commit 6e4ab94b8c

View File

@ -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);