Skip to content

Commit

Permalink
ensure only files are returned if requested
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Jul 13, 2021
1 parent cb917c7 commit 3916aee
Showing 1 changed file with 4 additions and 1 deletion.
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 3916aee

Please sign in to comment.