From e26187c7fff70a7006ba27b8d58622100b8c40c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julius=20H=C3=A4rtl?= Date: Thu, 1 Aug 2019 10:10:49 +0200 Subject: [PATCH] Make sure we only fetch the file by id for the actual owner MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Otherwise this will fetch all mounts for the file id which is quite expensive and causes long saving times in big sharing structures Signed-off-by: Julius Härtl --- apps/files_versions/lib/Storage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index c09633be3c1..c42083ff352 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -183,7 +183,7 @@ class Storage { $eventDispatcher = \OC::$server->getEventDispatcher(); $fileInfo = $files_view->getFileInfo($filename); $id = $fileInfo->getId(); - $nodes = \OC::$server->getRootFolder()->getById($id); + $nodes = \OC::$server->getRootFolder()->getUserFolder($uid)->getById($id); foreach ($nodes as $node) { $event = new CreateVersionEvent($node); $eventDispatcher->dispatch('OCA\Files_Versions::createVersion', $event); -- 2.39.5