]> source.dussan.org Git - nextcloud-server.git/commitdiff
Exclude .rnd files from integrity check 16492/head
authorDaniel Kesselberg <mail@danielkesselberg.de>
Sun, 21 Jul 2019 18:29:11 +0000 (20:29 +0200)
committerDaniel Kesselberg <mail@danielkesselberg.de>
Sun, 21 Jul 2019 18:29:11 +0000 (20:29 +0200)
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
lib/private/IntegrityCheck/Iterator/ExcludeFileByNameFilterIterator.php
tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php

index 26f4a56d15a64e0d231b44c0c12dbee16272712d..a82c74fd13895d6241591b866c364ac16b66a0b0 100644 (file)
@@ -43,6 +43,7 @@ class ExcludeFileByNameFilterIterator extends \RecursiveFilterIterator {
                'Thumbs.db', // Microsoft Windows
                '.directory', // Dolphin (KDE)
                '.webapp', // Gentoo/Funtoo & derivatives use a tool known as webapp-config to manage web-apps.
+               '.rnd',
        ];
 
        /**
@@ -54,7 +55,7 @@ class ExcludeFileByNameFilterIterator extends \RecursiveFilterIterator {
         */
        private $excludedFilenamePatterns = [
                '/^\.webapp-nextcloud-(\d+\.){2}(\d+)(-r\d+)?$/', // Gentoo/Funtoo & derivatives use a tool known as webapp-config to manage wep-apps.
-       ];
+       ];
 
        /**
         * @return bool
@@ -68,12 +69,12 @@ class ExcludeFileByNameFilterIterator extends \RecursiveFilterIterator {
                }
 
                $currentFileName = $current->getFilename();
-               if (in_array($currentFileName, $this->excludedFilenames, true)){
+               if (in_array($currentFileName, $this->excludedFilenames, true)) {
                        return false;
                }
 
-               foreach ($this->excludedFilenamePatterns as $pattern){
-                       if (preg_match($pattern, $currentFileName) > 0){
+               foreach ($this->excludedFilenamePatterns as $pattern) {
+                       if (preg_match($pattern, $currentFileName) > 0) {
                                return false;
                        }
                }
index 124618eb53865e1291863c87fcce5b39bf8e10da..8d5c38d275a9907b829b8659e5d26b21d70916ea 100644 (file)
@@ -45,6 +45,7 @@ class ExcludeFileByNameFilterIteratorTest extends TestCase {
                        ['.webapp-nextcloud-15.0.2', false],
                        ['.webapp-nextcloud-14.0.5-r3', false],
                        ['wx.webapp-nextcloud-obee', true],
+                       ['.rnd', false],
                ];
        }