diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 9928582c7a..0432c6b730 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -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 ); diff --git a/wp-admin/includes/update-core.php b/wp-admin/includes/update-core.php index fea68cbad2..bbf233eb70 100644 --- a/wp-admin/includes/update-core.php +++ b/wp-admin/includes/update-core.php @@ -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 ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 16b2bd8991..af2610ec52 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.