get correct user for paths to the trash bin, needed for remote shares if the size of of trash gets calculated

This commit is contained in:
Bjoern Schiessle 2015-01-30 14:39:09 +01:00
parent f4d20dc1f3
commit ed29c6ce86
2 changed files with 3 additions and 2 deletions

View File

@ -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];

View File

@ -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),
);
}