diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php index 553c52e72fe66433efdc34c2dc4c42121eacd5d6..ae9f0af4890b294c7ff8ef363237a3bb36862ecf 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 62fdb80d67146c3066a0a83f2a3f5a4c614396a1..3c82b941347701c90bc25e228e2485c3b2f8a829 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), ); } diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php index ead7f3e09ca93a63cab6775ab31a656cc413b9a8..8ce6d668d669462c108c12030baead790dbbf701 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'];