From 4596423b14015ad6d102195f6b0445f89dd82aa2 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Tue, 9 Jan 2018 19:51:50 +0100 Subject: [PATCH] Do not instantiate node when not needed Use the lazy functions is possible. This avoids getting the node if not required. Possible fix for #7751 Signed-off-by: Roeland Jago Douma --- lib/private/Share20/DefaultShareProvider.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index 844b36b2994cb..b9ab7a4687354 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -452,9 +452,9 @@ public function move(\OCP\Share\IShare $share, $recipient) { 'uid_owner' => $qb->createNamedParameter($share->getShareOwner()), 'uid_initiator' => $qb->createNamedParameter($share->getSharedBy()), 'parent' => $qb->createNamedParameter($share->getId()), - 'item_type' => $qb->createNamedParameter($share->getNode() instanceof File ? 'file' : 'folder'), - 'item_source' => $qb->createNamedParameter($share->getNode()->getId()), - 'file_source' => $qb->createNamedParameter($share->getNode()->getId()), + 'item_type' => $qb->createNamedParameter($share->getNodeType()), + 'item_source' => $qb->createNamedParameter($share->getNodeId()), + 'file_source' => $qb->createNamedParameter($share->getNodeId()), 'file_target' => $qb->createNamedParameter($share->getTarget()), 'permissions' => $qb->createNamedParameter($share->getPermissions()), 'stime' => $qb->createNamedParameter($share->getShareTime()->getTimestamp()),