Skip to content

Commit cd8fc1f

Browse files
committed
Fix add the condition to skip all the nested folders and its content
1 parent a463271 commit cd8fc1f

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/wp-admin/includes/file.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2058,6 +2058,8 @@ function copy_dir( $from, $to, $skip_list = array() ) {
20582058
foreach ( $skip_list as $skip_item ) {
20592059
if ( str_starts_with( $skip_item, $filename . '/' ) ) {
20602060
$sub_skip_list[] = preg_replace( '!^' . preg_quote( $filename, '!' ) . '/!i', '', $skip_item );
2061+
} elseif ( ! str_contains( $skip_item, '/' ) ) {
2062+
$sub_skip_list[] = $skip_item;
20612063
}
20622064
}
20632065

0 commit comments

Comments
 (0)