diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_versions/lib/Storage.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/apps/files_versions/lib/Storage.php b/apps/files_versions/lib/Storage.php index 4673b4850fa..e314eddb945 100644 --- a/apps/files_versions/lib/Storage.php +++ b/apps/files_versions/lib/Storage.php @@ -210,9 +210,18 @@ class Storage { $ownerNodes = $ownerFolder->getById($file->getId()); if (count($ownerNodes)) { $file = current($ownerNodes); + $uid = $mount->getShare()->getShareOwner(); } } + /** @var IUserManager $userManager */ + $userManager = \OC::$server->get(IUserManager::class); + $user = $userManager->get($uid); + + if (!$user) { + return false; + } + // no use making versions for empty files if ($file->getSize() === 0) { return false; @@ -227,7 +236,7 @@ class Storage { /** @var IVersionManager $versionManager */ $versionManager = \OC::$server->get(IVersionManager::class); - $versionManager->createVersion($file->getOwner(), $file); + $versionManager->createVersion($user, $file); } |