bug #19636 [Finder] no PHP warning on empty directory iteration (ggottwald)
This PR was squashed before being merged into the 2.7 branch (closes #19636).
Discussion
----------
[Finder] no PHP warning on empty directory iteration
| Q | A
| ------------- | ---
| Branch? | 2.8
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR | Since RecursiveDirectoryIterator::SKIP_DOTS is set as flag, opendir gets a warning if an empty directory is reached
Commits
-------
695e341
[Finder] no PHP warning on empty directory iteration
This commit is contained in:
commit
23cae581b8
@ -137,6 +137,10 @@ class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator
|
|||||||
return $this->rewindable;
|
return $this->rewindable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('' === $this->getPath()) {
|
||||||
|
return $this->rewindable = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (false !== $stream = @opendir($this->getPath())) {
|
if (false !== $stream = @opendir($this->getPath())) {
|
||||||
$infos = stream_get_meta_data($stream);
|
$infos = stream_get_meta_data($stream);
|
||||||
closedir($stream);
|
closedir($stream);
|
||||||
|
Reference in New Issue
Block a user