diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 6a41a7307a..ec5001a9ef 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -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) diff --git a/framework/helpers/BaseFileHelper.php b/framework/helpers/BaseFileHelper.php index d29805e40f..4ef2a9582e 100644 --- a/framework/helpers/BaseFileHelper.php +++ b/framework/helpers/BaseFileHelper.php @@ -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 {