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: https://develop.svn.wordpress.org/trunk@21222 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a30fde5be4
commit
641b92e43d
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user