avoid recursion on the root of the file system

fixes #9791
This commit is contained in:
Carsten Brandt
2015-09-29 15:36:24 +02:00
parent 191185f5e3
commit f007fc1e60
2 changed files with 3 additions and 1 deletions

View File

@ -455,7 +455,8 @@ class BaseFileHelper
return true;
}
$parentDir = dirname($path);
if ($recursive && !is_dir($parentDir)) {
// recurse if parent dir does not exist and we are not at the root of the file system.
if ($recursive && !is_dir($parentDir) && $parentDir !== $path) {
static::createDirectory($parentDir, $mode, true);
}
try {