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:
parent
6c6d746637
commit
18e83f9c36
@ -211,7 +211,9 @@ class WP_Filesystem_Base {
|
|||||||
$newdir = trailingslashit(path_join($base, $key));
|
$newdir = trailingslashit(path_join($base, $key));
|
||||||
if ( $this->verbose )
|
if ( $this->verbose )
|
||||||
printf( __('Changing to %s') . '<br/>', $newdir );
|
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;
|
return $ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user