diff options
author | Robin Appelman <robin@icewind.nl> | 2017-04-21 17:11:26 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-04-21 17:11:26 +0200 |
commit | 6fbe991afbb5df36c2fef5cac8c9681f91aed311 (patch) | |
tree | 6e47ce18420537a2a146c53cf46ea344e26c4564 /lib/private/Files/Node | |
parent | 140580f9d8468b8450f31dca997916a07693277f (diff) | |
download | nextcloud-server-6fbe991afbb5df36c2fef5cac8c9681f91aed311.tar.gz nextcloud-server-6fbe991afbb5df36c2fef5cac8c9681f91aed311.zip |
limit the user when searching for a file by id if we know the user already
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/Node')
-rw-r--r-- | lib/private/Files/Node/Folder.php | 7 |
1 files changed, 6 insertions, 1 deletions
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 */ |