[wp-trac] Re: [WordPress Trac] #8331: Automatic Plugin Installer always fails

WordPress Trac wp-trac at lists.automattic.com
Mon Nov 24 09:28:40 GMT 2008


#8331: Automatic Plugin Installer always fails
-----------------------------+----------------------------------------------
 Reporter:  ydekproductions  |        Owner:  anonymous
     Type:  defect           |       Status:  new      
 Priority:  high             |    Milestone:  2.7      
Component:  Administration   |      Version:  2.7      
 Severity:  normal           |   Resolution:           
 Keywords:                   |  
-----------------------------+----------------------------------------------
Comment (by ydekproductions):

 Ok, I'm digging into this and finding where the bug is.  It falls in the
 exists() function of class-wp-filesystem-ssh2.php

 {{{
         function exists($file) {
                 $this->debug("exists();");
                 $list = $this->run_command($this->link, sprintf('ls -lad
 %s', $file));
                 return (bool) $list;
         }
 }}}

 When no directory is found, $list is a newline character only.  Not an
 empty string.  So the newline character when cast to a boolean is
 considered true.

 Let me poke some pore time into this and see if I can come up with a patch
 that doesn't break everything else.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8331#comment:4>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list