Rewind RecursiveIteratorIterator before use
Fixes #268 and #288. More info: https://bugs.php.net/bug.php?id=62914 >As a reminder, all iterators have been designed in a way that you need to call rewind before using.
This commit is contained in:
parent
e8688573ab
commit
be00834d80
|
|
@ -385,6 +385,7 @@ class CmsObject implements ArrayAccess
|
|||
|
||||
$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dirPath));
|
||||
$it->setMaxDepth(1); // Support only a single level of subdirectories
|
||||
$it->rewind();
|
||||
|
||||
while($it->valid()) {
|
||||
if ($it->isFile() && in_array($it->getExtension(), static::$allowedExtensions)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue