[wp-trac] [WordPress Trac] #52342: Update copy_dir and _copy_dir for $dirlist error reporting

WordPress Trac noreply at wordpress.org
Fri Jan 29 00:03:49 UTC 2021


#52342: Update copy_dir and _copy_dir for $dirlist error reporting
-----------------------------+---------------------
 Reporter:  afragen          |       Owner:  (none)
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  5.7
Component:  Upgrade/Install  |     Version:
 Severity:  normal           |  Resolution:
 Keywords:  has-patch early  |     Focuses:
-----------------------------+---------------------

Comment (by dd32):

 Replying to [comment:7 afragen]:
 > @dd32 the potential issue is that if the `dirlist()` fails the first
 time through there is no error generated.

 Right, I'm pondering if this would be simple enough:
 {{{
 if ( false === $dirlist ) {
         return new WP_Error( 'dirlist_failed__copy_dir', __( 'Directory
 listing failed.' ), basename( $to ) );
 }
 }}}

 An empty directory (`array()`) wouldn't trigger that.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52342#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list