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