[wp-trac] [WordPress Trac] #52342: Update copy_dir and _copy_dir for $dirlist error reporting
WordPress Trac
noreply at wordpress.org
Thu Jan 28 03:58:45 UTC 2021
#52342: Update copy_dir and _copy_dir for $dirlist error reporting
-----------------------------+---------------------
Reporter: afragen | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 5.7
Component: Upgrade/Install | Version:
Severity: normal | Resolution:
Keywords: has-patch early | Focuses:
-----------------------------+---------------------
Comment (by dd32):
Looking at PR908, is the `$first_pass` parameter actually needed in
practice?
Looking at all of the WP_Filesystem `dirlist()` methods, there's three
distinct return types: `false`, `array()`, and `array( item, item )`;
Error, no files, and files respectively.
Even if it was triggered in one of the recursive loops, I think a
`WP_Error` in that case would also be relevant here?
It feels like just checking for `false` here would be enough?
The only questionable one
[https://core.trac.wordpress.org/browser/tags/5.6/src/wp-admin/includes
/class-wp-filesystem-ftpext.php?marks=723-729#L717 is ftpext::dirlist()]
where I'm thinking there's a possibility that some FTP servers might not
respect the `-a` flag passed and not return `.` entries.. but I think
that's so edge case I'm just looking for a real reason to say it's
problematic.
It looks like I changed it from being `false === $list` in [12999] so I
must've tested it at that point in time.
And yes, this needs to go in early in a cycle, and should not be
backported to a point release.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52342#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list