From 1b0cdeec37eb5251b1ce0593cd3fd2bba0c0ad9a Mon Sep 17 00:00:00 2001 From: Eddie Palmans Date: Sat, 11 May 2024 12:09:38 +0200 Subject: [PATCH] use DIRECTORY_SEPARATOR on determining excluded files --- src/TranslationsManager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/TranslationsManager.php b/src/TranslationsManager.php index e8d83df..94fcc92 100644 --- a/src/TranslationsManager.php +++ b/src/TranslationsManager.php @@ -86,7 +86,7 @@ public function getTranslations(string $locale): array *

$file is with language like en/book/create.php while $excludedFile contains only wildcards or path like book/create.php

*

So, we need to remove the language part from $file before comparing with $excludeFile

*/ - if (fnmatch($excludeFile, str_replace($locale.'/', '', $file))) { + if (fnmatch($excludeFile, str_replace($locale.DIRECTORY_SEPARATOR, '', $file))) { return false; } }