[wp-trac] [WordPress Trac] #10060: Incorrect behavior of "WP_Filesystem_FTPext -> exists"

WordPress Trac wp-trac at lists.automattic.com
Sun Jun 7 18:14:48 GMT 2009


#10060: Incorrect behavior of "WP_Filesystem_FTPext -> exists"
--------------------------+-------------------------------------------------
 Reporter:  gothicquark   |       Owner:  dd32
     Type:  defect (bug)  |      Status:  new 
 Priority:  normal        |   Milestone:  2.8 
Component:  Filesystem    |     Version:  2.8 
 Severity:  normal        |    Keywords:      
--------------------------+-------------------------------------------------
 FTP server on my web hosting returns something like a
 {{{
 ftpd: /www/dirname: No such file or directory
 }}}
 as a response of '''ftp_rawlist''' function. So this part of code works
 incorrectly
 {{{
 function exists($file) {
   $list = @ftp_rawlist($this->link, $file, false);
   return !empty($list); //empty list = no file, so invert.
 }
 }}}

 My temporary workaround is:
 {{{
 function exists($file) {
   $list = @ftp_rawlist($this->link, $file, false);
   return !(empty($list) || (strpos($list[0], "No such file or directory")
 !== FALSE));
 }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/10060>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list