Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: Only recurse on directories
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Feb 4, 2025
commit 5b27f07c8fadc69697d19b83b72f93187b80c295
9 changes: 8 additions & 1 deletion lib/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,12 @@ private function getRecursiveDirectoryIterator(string $folder, array $excludedPa
}
}
$exclusions = array_flip($excludedPaths);

$handle = opendir($folder);

if ($handle === false) {
throw new \Exception('Could not open '.$folder);
}
while ($name = readdir($handle)) {
if (in_array($name, ['.', '..'])) {
continue;
Expand All @@ -292,7 +297,9 @@ private function getRecursiveDirectoryIterator(string $folder, array $excludedPa
continue;
}
$path = $folder.'/'.$name;
yield from $this->getRecursiveDirectoryIterator($path, []);
if (is_dir($path)) {
yield from $this->getRecursiveDirectoryIterator($path, []);
}
yield $path => new \SplFileInfo($path);
}

Expand Down