Skip to content
Snippets Groups Projects

Resolve #3408488 "Make unknownpathexcluder accept"

1 file
+ 3
4
Compare changes
  • Side-by-side
  • Inline
@@ -102,20 +102,19 @@ final class UnknownPathExcluder implements EventSubscriberInterface {
// glob() flags aren't supported on all systems. We also can't use
// \Drupal\Core\File\FileSystemInterface::scanDirectory(), because it
// unconditionally ignores hidden files and directories.
$paths_in_project_root = [];
$unknown_paths = [];
$handle = opendir($project_root);
if (empty($handle)) {
throw new \RuntimeException("Could not scan for files in the project root.");
}
while ($entry = readdir($handle)) {
if ($entry === '.' || $entry === '..') {
if ($entry === '.' || $entry === '..' || in_array($entry, $known_paths, TRUE)) {
continue;
}
$paths_in_project_root[] = $entry;
$unknown_paths[] = $entry;
}
closedir($handle);
$unknown_paths = array_diff($paths_in_project_root, $known_paths);
$event->addPathsRelativeToProjectRoot($unknown_paths);
}
Loading