diff options
author | Morris Jobke <hey@morrisjobke.de> | 2019-02-27 15:55:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-27 15:55:20 +0100 |
commit | 3459ffc4d1bc4fb8fc7bccbb7ae999d165cbb5ad (patch) | |
tree | 6f7d520dbb81c2cc13fab6027b90c066f40e9dbe /apps | |
parent | 3664e46944e8bc0ef091aeae919f4bae6805513b (diff) | |
parent | e806aa658c16fadad465504fab4aeef314832bdb (diff) | |
download | nextcloud-server-3459ffc4d1bc4fb8fc7bccbb7ae999d165cbb5ad.tar.gz nextcloud-server-3459ffc4d1bc4fb8fc7bccbb7ae999d165cbb5ad.zip |
Merge pull request #13844 from felixn/bugfix/10862-trash-bin-ignores-trashbin_retention_obligation
Bugfix for issue 10862: Trash-bin ignores trashbin_retention_obligation
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files_trashbin/lib/Trashbin.php | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index 96c6a4c0af7..5adbdeca6ad 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -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 { |