Merge pull request #13797 from owncloud/fix_move_del_of_remote_shares

make sure that we get the correct user from the path
This commit is contained in:
Lukas Reschke 2015-01-31 08:52:07 +01:00
commit 012d06e8a2
3 changed files with 3 additions and 3 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),
);
}

View File

@ -152,7 +152,6 @@ class Trashbin {
self::setUpTrash($user);
$view = new \OC\Files\View('/' . $user);
$path_parts = pathinfo($file_path);
$filename = $path_parts['basename'];