mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-08 03:00:14 +00:00
Upgrade/Install: Return a WP_Error from copy_dir() and _copy_dir() if the directory listing failed.
Props afragen, dd32. Fixes #52342. git-svn-id: https://develop.svn.wordpress.org/trunk@50149 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 );
|
||||
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user