Merge pull request #16233 from owncloud/enc_fix_check_if_file_is_excluded

fix check if a file is excluded from encryption
This commit is contained in:
Morris Jobke 2015-05-12 09:12:38 +02:00
commit b11c0c533e
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),