WordPress.org

Make WordPress Core

Changeset 50149


Ignore:
Timestamp:
02/02/2021 05:21:45 PM (8 months ago)
Author:
SergeyBiryukov
Message:

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

Props afragen, dd32.
Fixes #52342.

Location:
trunk/src/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/file.php

    r50032 r50149  
    17771777    $dirlist = $wp_filesystem->dirlist( $from );
    17781778
     1779    if ( false === $dirlist ) {
     1780        return new WP_Error( 'dirlist_failed_copy_dir', __( 'Directory listing failed.' ), basename( $to ) );
     1781    }
     1782
    17791783    $from = trailingslashit( $from );
    17801784    $to   = trailingslashit( $to );
  • trunk/src/wp-admin/includes/update-core.php

    r49774 r50149  
    13531353    $dirlist = $wp_filesystem->dirlist( $from );
    13541354
     1355    if ( false === $dirlist ) {
     1356        return new WP_Error( 'dirlist_failed__copy_dir', __( 'Directory listing failed.' ), basename( $to ) );
     1357    }
     1358
    13551359    $from = trailingslashit( $from );
    13561360    $to   = trailingslashit( $to );
Note: See TracChangeset for help on using the changeset viewer.