0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-03-18 10:13:32 +00:00

Merge pull request 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
lib/private/encryption
tests/lib/encryption

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