fix check if file is excluded from encryption

This commit is contained in:
Bjoern Schiessle 2015-05-11 12:38:59 +02:00
parent ebf3953908
commit 9dd517071e
2 changed files with 2 additions and 1 deletions

View file

@ -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)) {

View file

@ -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),