From 101ddc102a80f74588e256c13eaa42ff2dbbe5d8 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Wed, 27 Dec 2023 18:50:07 +0300 Subject: [PATCH] Fixing fnmatch patterns --- helpers.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/helpers.inc.php b/helpers.inc.php index f73e0e0..dcc6cf1 100644 --- a/helpers.inc.php +++ b/helpers.inc.php @@ -378,10 +378,11 @@ function recurse_copy( $excluded = false; foreach($excludes as $exclude_pattern) $excluded = $excluded || (bool)preg_match("~$exclude_pattern~", $src . '/' . $file); + $fnmatched = sizeof($fnmatches) == 0; foreach($fnmatches as $fnmatch) - $excluded = $excluded || !fnmatch($fnmatch, $file); + $fnmatched = $fnmatched || fnmatch($fnmatch, $file); - if($excluded) + if($excluded || !$fnmatched) continue; _ensure_copy_file($src . '/' . $file, $dst . '/' . $file, $copy_mode, $mtime_check);