From ed29c6ce86a3e53599a2fef37b4d558e57b02ca7 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Fri, 30 Jan 2015 14:39:09 +0100 Subject: 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(-) (limited to 'apps') diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php index 553c52e72fe..ae9f0af4890 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 62fdb80d671..3c82b941347 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), ); } -- cgit v1.2.3 From 9ef96e4dd5ea10611e9741ae0303b328e7788be9 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Fri, 30 Jan 2015 14:39:31 +0100 Subject: no need to initialize the same view twice --- apps/files_trashbin/lib/trashbin.php | 1 - 1 file changed, 1 deletion(-) (limited to 'apps') diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php index 0576be66b4b..cf808915ec9 100644 --- a/apps/files_trashbin/lib/trashbin.php +++ b/apps/files_trashbin/lib/trashbin.php @@ -152,7 +152,6 @@ class Trashbin { self::setUpTrash($user); - $view = new \OC\Files\View('/' . $user); $path_parts = pathinfo($file_path); $filename = $path_parts['basename']; -- cgit v1.2.3