[wp-trac] [WordPress Trac] #20934: class-wp-filesystem-base::search_for_folder returns incorrect path

WordPress Trac wp-trac at lists.automattic.com
Wed Jun 13 05:54:24 UTC 2012


#20934: class-wp-filesystem-base::search_for_folder returns incorrect path
--------------------------+-----------------------------
 Reporter:  cgastrell     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.3.2
 Severity:  normal        |   Keywords:  needs-patch
--------------------------+-----------------------------
 == Intro ==
 I got myself in an unusual situation, so this bug will oddly be
 duplicated. Worth a ticket though.

 '''search_for_folder''' gets cut off in the wrong directory if a folder
 name is duplicated along the path.

 === Example ===

  /var/www/domain/htdocs/wp_install::
    will work nice

  /var/www/domain/www/wp_install::
    will fail


 === Case ===
 My situation is like this (in case i'm not being completely clear, pardon
 my english):

  live site path::
    /var/www/domain/www : working site
  test site path::
    /var/www/domain/test : working site installation duped and working
  path to ftp root::
    /var/www/

 Every operation via ftp (automatic updates, plugin delete, theme install,
 plugin install) done on the '''test site''' falls on the directory of
 '''live site'''

 When '''search_for_folder''' loops through the path parts
 (0=>var,1=>www,2=>domain,3=>www), as there are two path parts with the
 same name, it will be ''fouled'' into the first one. I don't know how else
 I could explain it, I'm not that good. Turning '''$this->verbose''' to
 ''true'' and adding '''print_r('key ' . $key .'<br />');''' at the
 begining of the foreach allowed me to understand how this was happening
 (will attach). My wp is in spanish, so, in the image, when it says
 'Cambiando' means 'Changing to' and 'Encontrado' means 'Found' (verbose
 messages).

 Hope somebody pick this and come up with some fixing.

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


More information about the wp-trac mailing list