Fixing fnmatch patterns

This commit is contained in:
Pavel Shevaev 2023-12-27 18:50:07 +03:00
parent 3aeb5a23db
commit 101ddc102a
1 changed files with 3 additions and 2 deletions

View File

@ -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);