[wp-trac] [WordPress Trac] #12232: Invalid Archive. Theme Install Failed. Caused by ftp_rawlist using -a option

WordPress Trac wp-trac at lists.automattic.com
Mon Mar 8 17:14:23 UTC 2010


#12232: Invalid Archive. Theme Install Failed. Caused by ftp_rawlist using -a
option
-----------------------------+----------------------------------------------
 Reporter:  frankindelicato  |       Owner:  dd32       
     Type:  defect (bug)     |      Status:  assigned   
 Priority:  normal           |   Milestone:  3.0        
Component:  General          |     Version:  2.9.1      
 Severity:  blocker          |    Keywords:  ftp_rawlist
-----------------------------+----------------------------------------------

Comment(by eoinomurchu):

 That said, my last point about PWD is incorrect, I was having some issues
 further on in the code. The following corrected it, and I don't seem to be
 having any problems.

 So in wp-admin/includes/class-wp-filesystem-ftpext.php

 replace
 {{{
         $list = @ftp_rawlist($this->link, '-a ' . $path, false);

         if ( empty($list) ) // Empty array = non-existent folder (real
 folder will show . at least)
                 return false;

 }}}
 with
 {{{
         $pwd = @ftp_pwd();
         $chdir = @ftp_chdir($this->link, $path);
         $list = @ftp_rawlist($this->link, '-a');
         @ftp_chdir($this->link, $pwd);

         if ( empty($list) || !$chdir ) // Empty array = non-existent
 folder real folder will show . at least)
                 return false;
 }}}

 This is a hack/workaround. It's not very pretty, but it does seem to fix
 the error.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12232#comment:11>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list