mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-30 05:09:06 +02:00
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
This commit is contained in:
parent
fc551f5e0c
commit
50667bf6c3
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user