Upgrade/Install: Return a `WP_Error` from `copy_dir()` and `_copy_dir()` if the directory listing failed.

Props afragen, dd32.
Fixes #52342.
Built from https://develop.svn.wordpress.org/trunk@50149


git-svn-id: http://core.svn.wordpress.org/trunk@49828 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-02-02 17:23:06 +00:00
parent aab7206ff8
commit 90ca61ba07
3 changed files with 9 additions and 1 deletions

View File

@ -1776,6 +1776,10 @@ 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 ) );
}
$from = trailingslashit( $from );
$to = trailingslashit( $to );

View File

@ -1352,6 +1352,10 @@ 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 ) );
}
$from = trailingslashit( $from );
$to = trailingslashit( $to );

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.7-alpha-50148';
$wp_version = '5.7-alpha-50149';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.