Skip to content

Commit

Permalink
ensure only files are returned if requested (#2089)
Browse files Browse the repository at this point in the history
* ensure only files are returned if requested

* changelog [skip ci]
  • Loading branch information
nadar authored Jul 13, 2021
1 parent cb917c7 commit 9907960
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ In order to read more about upgrading and BC breaks have a look at the [UPGRADE
+ [#2081](https://github.com/luyadev/luya/pull/2081) Removed deprecated methods and/or added a deprecation error trigger.
+ [#2077](https://github.com/luyadev/luya/pull/2077) Fix issue with caching when using SVG widget and symbol names.
+ [#2085](https://github.com/luyadev/luya/pull/2085) Option to disable language override by resolved composition content in UrlManager.
+ [#2089](https://github.com/luyadev/luya/pull/2089) Ensure that `scanDirectoryFiles()` returns only files and not folders.

## 1.9.0 (11. February 2021)

Expand Down
5 changes: 4 additions & 1 deletion core/console/commands/ImportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ protected function scanDirectoryFiles($path, $ns, $module)
foreach (scandir($path) as $file) {
if (substr($file, 0, 1) !== '.') {
$files[] = [
'isFile' => is_file($path.DIRECTORY_SEPARATOR.$file),
'file' => $file,
'filePath' => $path.DIRECTORY_SEPARATOR.$file,
'module' => $module,
Expand All @@ -116,7 +117,9 @@ public function getDirectoryFiles($folderName)
if (array_key_exists($folderName, $this->_dirs)) {
foreach ($this->_dirs[$folderName] as $folder) {
foreach ($folder['files'] as $file) {
$files[] = $file;
if ($file['isFile']) {
$files[] = $file;
}
}
}
}
Expand Down

0 comments on commit 9907960

Please sign in to comment.