Make WordPress Core


Ignore:
Timestamp:
02/02/2021 05:21:45 PM (6 years 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.

File:
1 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 );
Note: See TracChangeset for help on using the changeset viewer.