From 1484d01ff623317e6c14c02ad1053b68f30f2622 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 10 Oct 2016 14:16:25 +0200 Subject: [PATCH] explicitly cast to int Signed-off-by: Robin Appelman --- lib/private/Files/Node/Folder.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/Node/Folder.php b/lib/private/Files/Node/Folder.php index b12ded8e79..353b89068c 100644 --- a/lib/private/Files/Node/Folder.php +++ b/lib/private/Files/Node/Folder.php @@ -265,7 +265,7 @@ class Folder extends Node implements \OCP\Files\Folder { */ public function getById($id) { $mountCache = $this->root->getUserMountCache(); - $mountsContainingFile = $mountCache->getMountsForFileId($id); + $mountsContainingFile = $mountCache->getMountsForFileId((int)$id); $mounts = $this->root->getMountsIn($this->path); $mounts[] = $this->root->getMount($this->path); /** @var IMountPoint[] $folderMounts */ @@ -285,7 +285,10 @@ class Folder extends Node implements \OCP\Files\Folder { // we only need to get the cache info once, since all mounts we found point to the same storage $mount = $folderMounts[$mountsContainingFile[0]->getMountPoint()]; - $cacheEntry = $mount->getStorage()->getCache()->get($id); + $cacheEntry = $mount->getStorage()->getCache()->get((int)$id); + if (!$cacheEntry) { + return []; + } // cache jails will hide the "true" internal path $internalPath = ltrim($mountsContainingFile[0]->getRootInternalPath() . '/' . $cacheEntry->getPath(), '/');