Make sure we only fetch the file by id for the actual owner

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>
This commit is contained in:
Julius Härtl 2019-08-01 10:10:49 +02:00 committed by Backportbot
parent 11109c6dfa
commit 53bb2862f0

View 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);