From 81f934373a437392d956361249a5bc076e3eecf1 Mon Sep 17 00:00:00 2001 From: Chris Kankiewicz Date: Thu, 7 May 2020 20:20:05 -0700 Subject: [PATCH] Use OS specific directory separator in glob pattern and escape verbatim path segments --- app/src/Factories/FinderFactory.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/Factories/FinderFactory.php b/app/src/Factories/FinderFactory.php index 81a294f..9e1da31 100644 --- a/app/src/Factories/FinderFactory.php +++ b/app/src/Factories/FinderFactory.php @@ -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()); } }