[wp-trac] [WordPress Trac] #34976: Plug ins fail to update after WP 4.4 installed

WordPress Trac noreply at wordpress.org
Sat Dec 12 13:45:26 UTC 2015


#34976: Plug ins fail to update after WP 4.4 installed
----------------------------+--------------------
 Reporter:  patdundee       |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  4.4.1
Component:  Filesystem API  |     Version:  4.4
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+--------------------

Comment (by mensmaximus):

 Replying to [comment:50 Otto42]:
 > Okay, think I see the problem here. Stems from [34733].

 Well but that does not explain why reverting to 4.3.1 makes it work again
 because

 > Not really seeing a solution except to switch back to ftp_rawlist().

 does not apply to 4.3.1. ftp_nlist() has already been used in WP 4.3.1


 Version 4.3.1
 {{{#!php
 <?php
 public function exists($file) {
         $list = @ftp_nlist($this->link, $file);
         if ( empty( $list ) && $this->is_dir( $file ) ) {
                 return true; // File is an empty directory.
         }
         return !empty($list); //empty list = no file, so invert.
 }
 }}}

 Version 4.4
 {{{#!php
 <?php
 public function exists( $file ) {
         $path = dirname( $file );
         $filename = basename( $file );
         $file_list = @ftp_nlist( $this->link, '-a ' . $path );
         if ( $file_list ) {
                 $file_list = array_map( 'basename', $file_list );
         }
         return $file_list && in_array( $filename, $file_list );
 }
 }}}


 The question is why 4.4 is using the -a option at all. Do we need to check
 for hidden directories?

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


More information about the wp-trac mailing list