]> source.dussan.org Git - nextcloud-server.git/commitdiff
Make sure we only fetch the file by id for the actual owner 16624/head
authorJulius Härtl <jus@bitgrid.net>
Thu, 1 Aug 2019 08:10:49 +0000 (10:10 +0200)
committerJulius Härtl <jus@bitgrid.net>
Thu, 1 Aug 2019 08:10:49 +0000 (10:10 +0200)
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 <jus@bitgrid.net>
apps/files_versions/lib/Storage.php

index c09633be3c11d5cae2e07ee1a87c24e01cb693b5..c42083ff352bb85bf0024b923e2152af140427df 100644 (file)
@@ -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);