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

git-svn-id: http://core.svn.wordpress.org/trunk@21222 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2012-07-06 11:19:46 +00:00
parent 6c6d746637
commit 18e83f9c36

View File

@ -211,7 +211,9 @@ class WP_Filesystem_Base {
$newdir = trailingslashit(path_join($base, $key));
if ( $this->verbose )
printf( __('Changing to %s') . '<br/>', $newdir );
if ( $ret = $this->search_for_folder( $folder, $newdir, $loop) )
// only search for the remaining path tokens in the directory, not the full path again
$newfolder = implode( '/', array_slice( $folder_parts, $index + 1 ) );
if ( $ret = $this->search_for_folder( $newfolder, $newdir, $loop) )
return $ret;
}
}