[Finder] Partially revert #17134 to fix a regression
This commit is contained in:
parent
35666f05f7
commit
ead1824d3e
@ -39,11 +39,18 @@ abstract class FilterIterator extends \FilterIterator
|
||||
while ($iterator instanceof \OuterIterator) {
|
||||
$innerIterator = $iterator->getInnerIterator();
|
||||
|
||||
if ($innerIterator instanceof \FilesystemIterator) {
|
||||
if ($innerIterator instanceof RecursiveDirectoryIterator) {
|
||||
// this condition is necessary for iterators to work properly with non-local filesystems like ftp
|
||||
if ($innerIterator->isRewindable()) {
|
||||
$innerIterator->next();
|
||||
$innerIterator->rewind();
|
||||
}
|
||||
$iterator = $iterator->getInnerIterator();
|
||||
} elseif ($innerIterator instanceof \FilesystemIterator) {
|
||||
$innerIterator->next();
|
||||
$innerIterator->rewind();
|
||||
}
|
||||
|
||||
$iterator = $innerIterator;
|
||||
}
|
||||
|
||||
parent::rewind();
|
||||
|
Reference in New Issue
Block a user