1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-06 23:55:26 +02:00

[ticket/12268] Do not search in folders starting with a dot

PHPBB3-12268
This commit is contained in:
Joas Schilling 2014-03-14 00:30:07 +01:00
parent 329eb7c2b1
commit 59af5f4cbf

View File

@ -12,7 +12,7 @@ namespace phpbb\extension;
/**
* Class recursive_filter_iterator
*
* This Filter ignores .svn and .git directories.
* This filter ignores directories starting with a dot.
* When searching for php classes and template files of extensions
* we don't need to look inside these directories.
*
@ -20,13 +20,8 @@ namespace phpbb\extension;
*/
class recursive_filter_iterator extends \RecursiveFilterIterator
{
public static $ignore_folders = array(
'.svn',
'.git',
);
public function accept()
{
return !in_array($this->current()->getFilename(), self::$ignore_folders);
return !$this->current()->isDir() || substr($this->current()->getFilename(), 0, 1) !== '.';
}
}