diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-15 13:31:56 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-01-15 13:31:56 +0100 |
commit | 6824704699a87dbccabe61319610141e7411b90e (patch) | |
tree | 5030163c53cbb91f7ea518b4046666148d504291 /apps/files_trashbin | |
parent | 41106c1967cb7cbee20dd56666d9605eabdc4460 (diff) | |
parent | 94200b682cacbbb5fe673fad64ec5bf1d12f34fc (diff) | |
download | nextcloud-server-6824704699a87dbccabe61319610141e7411b90e.tar.gz nextcloud-server-6824704699a87dbccabe61319610141e7411b90e.zip |
Merge pull request #21117 from owncloud/owner-file-exists
Only return an owner if the file exists + improved getUidAndFilename
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r-- | apps/files_trashbin/lib/trashbin.php | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php index fdca25ff457..ca3a8b178a2 100644 --- a/apps/files_trashbin/lib/trashbin.php +++ b/apps/files_trashbin/lib/trashbin.php @@ -63,7 +63,11 @@ class Trashbin { * @param array $params */ public static function ensureFileScannedHook($params) { - self::getUidAndFilename($params['path']); + try { + self::getUidAndFilename($params['path']); + } catch (NotFoundException $e) { + // nothing to scan for non existing files + } } /** @@ -72,18 +76,7 @@ class Trashbin { * @throws \OC\User\NoUserException */ public static function getUidAndFilename($filename) { - $uid = \OC\Files\Filesystem::getOwner($filename); - \OC\Files\Filesystem::initMountPoints($uid); - if ($uid != \OCP\User::getUser()) { - $info = \OC\Files\Filesystem::getFileInfo($filename); - $ownerView = new \OC\Files\View('/' . $uid . '/files'); - try { - $filename = $ownerView->getPath($info['fileid']); - } catch (NotFoundException $e) { - $filename = null; - } - } - return [$uid, $filename]; + return Filesystem::getView()->getUidAndFilename($filename); } /** |