From 30bc3653d7956f8c2c9deddf9e021a205873e67a Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Thu, 5 Jan 2023 15:51:21 +0100 Subject: [PATCH] do not traverse into invoice template subdirectories (#3735) --- src/Repository/InvoiceDocumentRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Repository/InvoiceDocumentRepository.php b/src/Repository/InvoiceDocumentRepository.php index 14580b309..897277a6a 100644 --- a/src/Repository/InvoiceDocumentRepository.php +++ b/src/Repository/InvoiceDocumentRepository.php @@ -161,7 +161,7 @@ final class InvoiceDocumentRepository continue; } - $finder = Finder::create()->ignoreDotFiles(true)->files()->in($searchDir)->name('*.*'); + $finder = Finder::create()->ignoreDotFiles(true)->files()->in($searchDir)->depth(0)->name('*.*'); foreach ($finder->getIterator() as $file) { $doc = new InvoiceDocument($file); // the first found invoice document wins