diff options
author | Andreas Fischer <bantu@phpbb.com> | 2014-05-23 00:19:32 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2014-05-23 00:19:32 +0200 |
commit | b0dd144fe3e40202a8b07d7fc29f7c40f78d2a85 (patch) | |
tree | 4cc28d09a729a64e9e2ea67002d1831294bafc26 | |
parent | a2cd9c2464b2f83ec005831955d2f027c9c0210a (diff) | |
parent | 1572aca7b08cfb92aef36498ff2f19120864abd0 (diff) | |
download | forums-b0dd144fe3e40202a8b07d7fc29f7c40f78d2a85.tar forums-b0dd144fe3e40202a8b07d7fc29f7c40f78d2a85.tar.gz forums-b0dd144fe3e40202a8b07d7fc29f7c40f78d2a85.tar.bz2 forums-b0dd144fe3e40202a8b07d7fc29f7c40f78d2a85.tar.xz forums-b0dd144fe3e40202a8b07d7fc29f7c40f78d2a85.zip |
Merge pull request #2491 from nickvergessen/ticket/12586
Ticket/12586 Filter files and depth when looking for extensions
* nickvergessen/ticket/12586:
[ticket/12586] Limit depth to 2, we require vendor/extension/ext.php
[ticket/12586] Use dot filter when trying to find available extensions
-rw-r--r-- | phpBB/phpbb/extension/manager.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/phpBB/phpbb/extension/manager.php b/phpBB/phpbb/extension/manager.php index b22fbf07a6..604f680af2 100644 --- a/phpBB/phpbb/extension/manager.php +++ b/phpBB/phpbb/extension/manager.php @@ -409,8 +409,13 @@ class manager } $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($this->phpbb_root_path . 'ext/', \FilesystemIterator::NEW_CURRENT_AND_KEY | \FilesystemIterator::FOLLOW_SYMLINKS), - \RecursiveIteratorIterator::SELF_FIRST); + new \phpbb\recursive_dot_prefix_filter_iterator( + new \RecursiveDirectoryIterator($this->phpbb_root_path . 'ext/', \FilesystemIterator::NEW_CURRENT_AND_KEY | \FilesystemIterator::FOLLOW_SYMLINKS) + ), + \RecursiveIteratorIterator::SELF_FIRST + ); + $iterator->setMaxDepth(2); + foreach ($iterator as $file_info) { if ($file_info->isFile() && $file_info->getFilename() == 'ext.' . $this->php_ext) |