[wp-trac] [WordPress Trac] #30642: Infinite Loop created when $target_parent is outside of base_dir

WordPress Trac noreply at wordpress.org
Tue Dec 9 16:36:06 UTC 2014


#30642: Infinite Loop created when $target_parent is outside of base_dir
----------------------------+-----------------------------
 Reporter:  kanyuga         |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  General         |    Version:  4.0.1
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 We had a client who was moving from wordpress to plesk. As such his root
 directory changed from `/home/foo/public_html/` to `/var/www/vhosts/bar/`.
 He had set his upload path to `/home/foo/public_html/wp-content` causing
 the server to throw a warning on line 1497 of `wp-includes/functions.php`
 below resulting in an infinite loop that throws up errors.

 We are using PHP 5.5.9.

 {{{
 // We need to find the permissions of the parent folder that exists and
 inherit that.
 $target_parent = dirname( $target );
 while ( '.' != $target_parent && ! is_dir( $target_parent ) ) {
     $target_parent = dirname( $target_parent );
 }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30642>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list