diff --git a/lib/Folder/FolderManager.php b/lib/Folder/FolderManager.php index a971b83dc..3c62607dd 100644 --- a/lib/Folder/FolderManager.php +++ b/lib/Folder/FolderManager.php @@ -171,7 +171,7 @@ public function getFolder($id, $rootStorageId) { $row = $query->execute()->fetch(); return $row ? [ - 'id' => $id, + 'id' => (int)$id, 'mount_point' => $row['mount_point'], 'groups' => isset($applicableMap[$id]) ? $applicableMap[$id] : [], 'quota' => $row['quota'], diff --git a/lib/Trash/TrashBackend.php b/lib/Trash/TrashBackend.php index e580847c7..257c46acf 100644 --- a/lib/Trash/TrashBackend.php +++ b/lib/Trash/TrashBackend.php @@ -230,7 +230,7 @@ private function getNodeForTrashItem(IUser $user, ITrashItem $trashItem) { $folders = $this->folderManager->getFoldersForUser($user); foreach ($folders as $groupFolder) { if ($groupFolder['folder_id'] === (int)$folderId) { - $trashRoot = $this->getTrashFolder($folderId); + $trashRoot = $this->getTrashFolder((int)$folderId); try { $node = $trashRoot->get($path); if (!$this->userHasAccessToPath($user, $folderId . '/' . $trashItem->getOriginalLocation())) { @@ -245,13 +245,13 @@ private function getNodeForTrashItem(IUser $user, ITrashItem $trashItem) { return null; } - private function getTrashFolder($folderId) { + private function getTrashFolder(int $folderId) { try { return $this->appFolder->get('trash/' . $folderId); } catch (NotFoundException $e) { /** @var Folder $trashRoot */ $trashRoot = $this->appFolder->nodeExists('trash') ? $this->appFolder->get('trash') : $this->appFolder->newFolder('trash'); - return $trashRoot->newFolder($folderId); + return $trashRoot->newFolder((string)$folderId); } }