mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Merge pull request #298 from Naxiz/master
Rewind RecursiveIteratorIterator before use
This commit is contained in:
commit
b6a24fdf9b
@ -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…
x
Reference in New Issue
Block a user