[Finder] Fix ignoring of unreadable dirs in the RecursiveDirectoryIterator.

This commit is contained in:
Jakub Zalas 2014-04-23 21:22:53 +01:00
parent 3d14556bd9
commit 13466415c4
1 changed files with 8 additions and 1 deletions

View File

@ -68,7 +68,14 @@ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
public function getChildren()
{
try {
return parent::getChildren();
$children = parent::getChildren();
if ($children instanceof self) {
// parent method will call the constructor with default arguments, so unreadable dirs won't be ignored anymore
$children->ignoreUnreadableDirs = $this->ignoreUnreadableDirs;
}
return $children;
} catch (\UnexpectedValueException $e) {
if ($this->ignoreUnreadableDirs) {
// If directory is unreadable and finder is set to ignore it, a fake empty content is returned.