From ed29c6ce86a3e53599a2fef37b4d558e57b02ca7 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Fri, 30 Jan 2015 14:39:09 +0100 Subject: [PATCH] get correct user for paths to the trash bin, needed for remote shares if the size of of trash gets calculated --- apps/files_encryption/lib/helper.php | 4 ++-- apps/files_encryption/tests/helper.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php index 553c52e72f..ae9f0af489 100644 --- a/apps/files_encryption/lib/helper.php +++ b/apps/files_encryption/lib/helper.php @@ -293,8 +293,8 @@ class Helper { public static function getUserFromPath($path) { $split = self::splitPath($path); - if (count($split) > 3 && ( - $split[2] === 'files' || $split[2] === 'files_versions' || $split[2] === 'cache')) { + if (count($split) > 2 && ( + $split[2] === 'files' || $split[2] === 'files_versions' || $split[2] === 'cache' || $split[2] === 'files_trashbin')) { $user = $split[1]; diff --git a/apps/files_encryption/tests/helper.php b/apps/files_encryption/tests/helper.php index 62fdb80d67..3c82b94134 100644 --- a/apps/files_encryption/tests/helper.php +++ b/apps/files_encryption/tests/helper.php @@ -219,6 +219,7 @@ class TestHelper extends TestCase { return array( array('/' . self::TEST_ENCRYPTION_HELPER_USER1 . '/files/foo.txt', self::TEST_ENCRYPTION_HELPER_USER1), array('//' . self::TEST_ENCRYPTION_HELPER_USER2 . '/files_versions/foo.txt', self::TEST_ENCRYPTION_HELPER_USER2), + array('/' . self::TEST_ENCRYPTION_HELPER_USER1 . '/files_trashbin/', self::TEST_ENCRYPTION_HELPER_USER1), array(self::TEST_ENCRYPTION_HELPER_USER1 . '//cache/foo/bar.txt', self::TEST_ENCRYPTION_HELPER_USER1), ); }