Merge pull request #14415 from nextcloud/backport/13844/stable14

[stable14] Bugfix for issue 10862: Trash-bin ignores trashbin_retention_obligation
This commit is contained in:
Roeland Jago Douma 2019-02-28 09:43:31 +01:00 committed by GitHub
commit 84c2dfd442
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -680,11 +680,10 @@ class Trashbin {
// calculate available space for trash bin
// subtract size of files and current trash bin size from quota
if ($softQuota) {
$userFolder = \OC::$server->getUserFolder($user);
if(is_null($userFolder)) {
return 0;
}
$free = $quota - $userFolder->getSize(); // remaining free space for user
$files_view = new View('/' . $user . '/files');
$rootInfo = $files_view->getFileInfo('/', false);
$free = $quota - $rootInfo['size']; // remaining free space for user
if ($free > 0) {
$availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $trashbinSize; // how much space can be used for versions
} else {