diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2020-08-31 23:10:04 +0200 |
---|---|---|
committer | Daniel Kesselberg <mail@danielkesselberg.de> | 2020-08-31 23:11:10 +0200 |
commit | 2513b64602b291253813f6b83c6c52b2f50f2d0a (patch) | |
tree | 02eac250a13879c90f13a83cf2550382116e68c2 /apps/files_trashbin/lib | |
parent | 8dd249937f1252586a7e4674caf3c9b96bf835de (diff) | |
download | nextcloud-server-2513b64602b291253813f6b83c6c52b2f50f2d0a.tar.gz nextcloud-server-2513b64602b291253813f6b83c6c52b2f50f2d0a.zip |
Change free space calculation
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
Diffstat (limited to 'apps/files_trashbin/lib')
-rw-r--r-- | apps/files_trashbin/lib/Trashbin.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index 1e22349f2bb..6e7ef18b139 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -708,11 +708,13 @@ class Trashbin { */ private static function calculateFreeSpace($trashbinSize, $user) { $config = \OC::$server->getConfig(); - $systemTrashbinSize = (int)$config->getAppValue('files_trashbin', 'trashbin_size', '-1'); $userTrashbinSize = (int)$config->getUserValue($user, 'files_trashbin', 'trashbin_size', '-1'); - $configuredTrashbinSize = ($userTrashbinSize < 0) ? $systemTrashbinSize : $userTrashbinSize; - if ($configuredTrashbinSize) { - return $configuredTrashbinSize - $trashbinSize; + if ($userTrashbinSize > -1) { + return $userTrashbinSize - $trashbinSize; + } + $systemTrashbinSize = (int)$config->getAppValue('files_trashbin', 'trashbin_size', '-1'); + if ($systemTrashbinSize > -1) { + return $systemTrashbinSize - $trashbinSize; } $softQuota = true; |