From b14700c9360b2589d35b20b00bc5b863d7fb8243 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Thu, 14 Feb 2019 12:00:47 +0100 Subject: Use more precise regex Signed-off-by: Daniel Kesselberg --- .../IntegrityCheck/Iterator/ExcludeFileByNameFilterIterator.php | 2 +- .../IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/private/IntegrityCheck/Iterator/ExcludeFileByNameFilterIterator.php b/lib/private/IntegrityCheck/Iterator/ExcludeFileByNameFilterIterator.php index ca0464d9d5c..26f4a56d15a 100644 --- a/lib/private/IntegrityCheck/Iterator/ExcludeFileByNameFilterIterator.php +++ b/lib/private/IntegrityCheck/Iterator/ExcludeFileByNameFilterIterator.php @@ -53,7 +53,7 @@ class ExcludeFileByNameFilterIterator extends \RecursiveFilterIterator { * @var array */ private $excludedFilenamePatterns = [ - '/^\.webapp-nextcloud-.*/', // Gentoo/Funtoo & derivatives use a tool known as webapp-config to manage wep-apps. + '/^\.webapp-nextcloud-(\d+\.){2}(\d+)(-r\d+)?$/', // Gentoo/Funtoo & derivatives use a tool known as webapp-config to manage wep-apps. ]; /** diff --git a/tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php b/tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php index 335f6e3fd3d..124618eb538 100644 --- a/tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php +++ b/tests/lib/IntegrityCheck/Iterator/ExcludeFileByNameFilterIteratorTest.php @@ -34,7 +34,6 @@ class ExcludeFileByNameFilterIteratorTest extends TestCase { ->disableOriginalConstructor() ->setMethods(['current']) ->getMock(); - } public function fileNameProvider(): array { @@ -43,7 +42,8 @@ class ExcludeFileByNameFilterIteratorTest extends TestCase { ['Thumbs.db', false], ['another file', true], ['.directory', false], - ['.webapp-nextcloud-12.0.5', false], + ['.webapp-nextcloud-15.0.2', false], + ['.webapp-nextcloud-14.0.5-r3', false], ['wx.webapp-nextcloud-obee', true], ]; } -- cgit v1.2.3