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

@ -20,6 +20,7 @@ Yii Framework 2 Change Log
- Bug #9681: `Json::encode()` was erroring under CYGWIN (samdark)
- Bug #9714: Fixed `yii\rbac\PhpManager::updateItem()` unable to save users assignments (rezident1307)
- Bug #9754: Fixed `yii\web\Request` error when path info is empty (dynasource)
- Bug #9791: Fixed endless loop on file creation for non-existing device letters on windows (lukos, cebe)
- Enh #7581: Added ability to specify range using anonymous function in `RangeValidator` (RomeroMsk)
- Enh #8613: `yii\widgets\FragmentCache` will not store empty content anymore which fixes some problems related to `yii\filters\PageCache` (kidol)
- Enh #9476: Added DI injection via controller action method signature (mdmunir)

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 {