Make WordPress Core

Changeset 55538


Ignore:
Timestamp:
03/11/2023 11:32:54 AM (15 months ago)
Author:
SergeyBiryukov
Message:

Filesystem API: Return correct error data from copy_dir() if the directory listing failed.

The ::dirlist() method is run on the $from directory, so basename( $from ) is the correct thing to pass to the WP_Error object.

Follow-up to [50149].

Props afragen, costdev, pravinparmar2404.
Fixes #57907.

File:
1 edited

Legend:

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

    r55412 r55538  
    19051905
    19061906    if ( false === $dirlist ) {
    1907         return new WP_Error( 'dirlist_failed_copy_dir', __( 'Directory listing failed.' ), basename( $to ) );
     1907        return new WP_Error( 'dirlist_failed_copy_dir', __( 'Directory listing failed.' ), basename( $from ) );
    19081908    }
    19091909
Note: See TracChangeset for help on using the changeset viewer.