From: Bjoern Schiessle Date: Fri, 30 Jan 2015 13:39:09 +0000 (+0100) Subject: get correct user for paths to the trash bin, needed for remote shares if the size... X-Git-Tag: v8.0.0RC2~18^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ed29c6ce86a3e53599a2fef37b4d558e57b02ca7;p=nextcloud-server.git get correct user for paths to the trash bin, needed for remote shares if the size of of trash gets calculated --- 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), ); }