Use OS specific directory separator in glob pattern and escape verbatim path segments

This commit is contained in:
Chris Kankiewicz
2020-05-07 20:20:05 -07:00
parent 13cee61ba5
commit 81f934373a

View File

@@ -101,7 +101,9 @@ class FinderFactory
protected function isHidden(SplFileInfo $file): bool
{
return Glob::pattern(
sprintf('%s/{%s}', $this->container->get('base_path'), $this->hiddenFiles()->implode(','))
Glob::escape(
$this->container->get('base_path') . DIRECTORY_SEPARATOR
) . sprintf('{%s}', $this->hiddenFiles()->implode(','))
)->matchStart($file->getRealPath());
}
}