mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Filesystem API: Return correct error data from copy_dir() if the directory listing failed.
The `::dirlist()` method is run on the `$from` directory, so `basename( $from )` is the correct thing to pass to the `WP_Error` object. Follow-up to [50149]. Props afragen, costdev, pravinparmar2404. Fixes #57907. git-svn-id: https://develop.svn.wordpress.org/trunk@55538 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c421c7ead6
commit
de504cbaee
@ -1904,7 +1904,7 @@ function copy_dir( $from, $to, $skip_list = array() ) {
|
||||
$dirlist = $wp_filesystem->dirlist( $from );
|
||||
|
||||
if ( false === $dirlist ) {
|
||||
return new WP_Error( 'dirlist_failed_copy_dir', __( 'Directory listing failed.' ), basename( $to ) );
|
||||
return new WP_Error( 'dirlist_failed_copy_dir', __( 'Directory listing failed.' ), basename( $from ) );
|
||||
}
|
||||
|
||||
$from = trailingslashit( $from );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user