@@ -31,53 +31,53 @@ |
||
31 | 31 | * @package OC\Integritycheck\Iterator |
32 | 32 | */ |
33 | 33 | class ExcludeFileByNameFilterIterator extends \RecursiveFilterIterator { |
34 | - /** |
|
35 | - * Array of excluded file names. Those are not scanned by the integrity checker. |
|
36 | - * This is used to exclude files which administrators could upload by mistakes |
|
37 | - * such as .DS_Store files. |
|
38 | - * |
|
39 | - * @var array |
|
40 | - */ |
|
41 | - private $excludedFilenames = [ |
|
42 | - '.DS_Store', // Mac OS X |
|
43 | - 'Thumbs.db', // Microsoft Windows |
|
44 | - '.directory', // Dolphin (KDE) |
|
45 | - '.webapp', // Gentoo/Funtoo & derivatives use a tool known as webapp-config to manage web-apps. |
|
46 | - ]; |
|
34 | + /** |
|
35 | + * Array of excluded file names. Those are not scanned by the integrity checker. |
|
36 | + * This is used to exclude files which administrators could upload by mistakes |
|
37 | + * such as .DS_Store files. |
|
38 | + * |
|
39 | + * @var array |
|
40 | + */ |
|
41 | + private $excludedFilenames = [ |
|
42 | + '.DS_Store', // Mac OS X |
|
43 | + 'Thumbs.db', // Microsoft Windows |
|
44 | + '.directory', // Dolphin (KDE) |
|
45 | + '.webapp', // Gentoo/Funtoo & derivatives use a tool known as webapp-config to manage web-apps. |
|
46 | + ]; |
|
47 | 47 | |
48 | - /** |
|
49 | - * Array of excluded file name parts. Those are not scanned by the integrity checker. |
|
50 | - * These strings are regular expressions and any file names |
|
51 | - * matching these expressions are ignored. |
|
52 | - * |
|
53 | - * @var array |
|
54 | - */ |
|
55 | - private $excludedFilenamePatterns = [ |
|
56 | - '/^\.webapp-nextcloud-(\d+\.){2}(\d+)(-r\d+)?$/', // Gentoo/Funtoo & derivatives use a tool known as webapp-config to manage wep-apps. |
|
57 | - ]; |
|
48 | + /** |
|
49 | + * Array of excluded file name parts. Those are not scanned by the integrity checker. |
|
50 | + * These strings are regular expressions and any file names |
|
51 | + * matching these expressions are ignored. |
|
52 | + * |
|
53 | + * @var array |
|
54 | + */ |
|
55 | + private $excludedFilenamePatterns = [ |
|
56 | + '/^\.webapp-nextcloud-(\d+\.){2}(\d+)(-r\d+)?$/', // Gentoo/Funtoo & derivatives use a tool known as webapp-config to manage wep-apps. |
|
57 | + ]; |
|
58 | 58 | |
59 | - /** |
|
60 | - * @return bool |
|
61 | - */ |
|
62 | - public function accept() { |
|
63 | - /** @var \SplFileInfo $current */ |
|
64 | - $current = $this->current(); |
|
59 | + /** |
|
60 | + * @return bool |
|
61 | + */ |
|
62 | + public function accept() { |
|
63 | + /** @var \SplFileInfo $current */ |
|
64 | + $current = $this->current(); |
|
65 | 65 | |
66 | - if ($current->isDir()) { |
|
67 | - return true; |
|
68 | - } |
|
66 | + if ($current->isDir()) { |
|
67 | + return true; |
|
68 | + } |
|
69 | 69 | |
70 | - $currentFileName = $current->getFilename(); |
|
71 | - if (in_array($currentFileName, $this->excludedFilenames, true)){ |
|
72 | - return false; |
|
73 | - } |
|
70 | + $currentFileName = $current->getFilename(); |
|
71 | + if (in_array($currentFileName, $this->excludedFilenames, true)){ |
|
72 | + return false; |
|
73 | + } |
|
74 | 74 | |
75 | - foreach ($this->excludedFilenamePatterns as $pattern){ |
|
76 | - if (preg_match($pattern, $currentFileName) > 0){ |
|
77 | - return false; |
|
78 | - } |
|
79 | - } |
|
75 | + foreach ($this->excludedFilenamePatterns as $pattern){ |
|
76 | + if (preg_match($pattern, $currentFileName) > 0){ |
|
77 | + return false; |
|
78 | + } |
|
79 | + } |
|
80 | 80 | |
81 | - return true; |
|
82 | - } |
|
81 | + return true; |
|
82 | + } |
|
83 | 83 | } |
@@ -68,12 +68,12 @@ |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | $currentFileName = $current->getFilename(); |
71 | - if (in_array($currentFileName, $this->excludedFilenames, true)){ |
|
71 | + if (in_array($currentFileName, $this->excludedFilenames, true)) { |
|
72 | 72 | return false; |
73 | 73 | } |
74 | 74 | |
75 | - foreach ($this->excludedFilenamePatterns as $pattern){ |
|
76 | - if (preg_match($pattern, $currentFileName) > 0){ |
|
75 | + foreach ($this->excludedFilenamePatterns as $pattern) { |
|
76 | + if (preg_match($pattern, $currentFileName) > 0) { |
|
77 | 77 | return false; |
78 | 78 | } |
79 | 79 | } |