Merge pull request #16630 from nextcloud/backport/16624/stable16

[stable16] Make sure we only fetch the file by id for the actual owner
This commit is contained in:
blizzz 2019-08-01 22:47:29 +02:00 committed by GitHub
commit 291f85f0b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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