From 9dd517071e60ff3677ea79e84577f3556ac7d4cc Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Mon, 11 May 2015 12:38:59 +0200 Subject: [PATCH] fix check if file is excluded from encryption --- lib/private/encryption/util.php | 2 +- tests/lib/encryption/utiltest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/private/encryption/util.php b/lib/private/encryption/util.php index 032ac83f37..45d4dd90d9 100644 --- a/lib/private/encryption/util.php +++ b/lib/private/encryption/util.php @@ -357,7 +357,7 @@ class Util { public function isExcluded($path) { $normalizedPath = \OC\Files\Filesystem::normalizePath($path); $root = explode('/', $normalizedPath, 4); - if (count($root) > 2) { + if (count($root) > 1) { //detect system wide folders if (in_array($root[1], $this->excludedPaths)) { diff --git a/tests/lib/encryption/utiltest.php b/tests/lib/encryption/utiltest.php index 7de5704392..0154fa30f7 100644 --- a/tests/lib/encryption/utiltest.php +++ b/tests/lib/encryption/utiltest.php @@ -135,6 +135,7 @@ class UtilTest extends TestCase { public function providePathsForTestIsExcluded() { return array( + array('/files_encryption', true), array('files_encryption/foo.txt', true), array('test/foo.txt', false), array('/user1/files_encryption/foo.txt', true),