Make WordPress Core

Changeset 21222


Ignore:
Timestamp:
07/06/2012 11:19:46 AM (12 years ago)
Author:
dd32
Message:

WP_Filesystem: When recursivly searching for a directory path, only search for unfound directory entries. This solves a case where the same directory may be entered twice inadvertantly when nested directories using the same name exist. Fixes #20652

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-filesystem-base.php

    r21221 r21222  
    212212                if ( $this->verbose )
    213213                    printf( __('Changing to %s') . '<br/>', $newdir );
    214                 if ( $ret = $this->search_for_folder( $folder, $newdir, $loop) )
     214                // only search for the remaining path tokens in the directory, not the full path again
     215                $newfolder = implode( '/', array_slice( $folder_parts, $index + 1 ) );
     216                if ( $ret = $this->search_for_folder( $newfolder, $newdir, $loop) )
    215217                    return $ret;
    216218            }
Note: See TracChangeset for help on using the changeset viewer.