[wp-trac] [WordPress Trac] #65150: Issue with copy_dir() function t does not skips folders.
WordPress Trac
noreply at wordpress.org
Wed Apr 29 17:43:38 UTC 2026
#65150: Issue with copy_dir() function t does not skips folders.
----------------------------+------------------------------
Reporter: neo2k23 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Filesystem API | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
----------------------------+------------------------------
Comment (by neo2k23):
Btw instead of this
{{{
foreach ( $skip_list as $skip_item ) {
if ( str_starts_with( $skip_item, $filename . '/' ) ) {
$sub_skip_list[] = preg_replace( '!^' . preg_quote( $filename,
'!' ) . '/!i', '', $skip_item );
+ } elseif ( ! str_contains( $skip_item, '/' ) ) {
+ $sub_skip_list[] = $skip_item;
}
}
}}}
You just could use this
{{{
foreach ( $skip_list as $skip_item ) {
if ( ! str_contains( $skip_item, '/' ) ) {
$sub_skip_list[] = $skip_item;
}
}
}}}
It will work just as well.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/65150#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list