From 6fbe991afbb5df36c2fef5cac8c9681f91aed311 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 21 Apr 2017 17:11:26 +0200 Subject: limit the user when searching for a file by id if we know the user already Signed-off-by: Robin Appelman --- lib/private/Files/Node/Folder.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/private/Files/Node') diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php index 9809c6b7d11..fcadbe27393 100644 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@ -280,7 +280,12 @@ class Folder extends Node implements \OCP\Files\Folder { */ public function getById($id) { $mountCache = $this->root->getUserMountCache(); - $mountsContainingFile = $mountCache->getMountsForFileId((int)$id); + if (strpos($this->getPath(), '/', 1) > 0) { + list(, $user) = explode('/', $this->getPath()); + } else { + $user = null; + } + $mountsContainingFile = $mountCache->getMountsForFileId((int)$id, $user); $mounts = $this->root->getMountsIn($this->path); $mounts[] = $this->root->getMount($this->path); /** @var IMountPoint[] $folderMounts */ -- cgit v1.2.3