summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-01-30 14:39:09 +0100
committerBjoern Schiessle <schiessle@owncloud.com>2015-01-30 14:39:09 +0100
commited29c6ce86a3e53599a2fef37b4d558e57b02ca7 (patch)
tree23b62b4ef2e44753d43bdd07f6cc32bc1aa6f112
parentf4d20dc1f30d4ab4748166956fcacdaeb0773e75 (diff)
downloadnextcloud-server-ed29c6ce86a3e53599a2fef37b4d558e57b02ca7.tar.gz
nextcloud-server-ed29c6ce86a3e53599a2fef37b4d558e57b02ca7.zip
get correct user for paths to the trash bin, needed for remote shares if the size of of trash gets calculated
-rw-r--r--apps/files_encryption/lib/helper.php4
-rw-r--r--apps/files_encryption/tests/helper.php1
2 files changed, 3 insertions, 2 deletions
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),
);
}