diff options
author | Daniel Kesselberg <mail@danielkesselberg.de> | 2020-08-31 23:10:04 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2020-09-03 07:33:20 +0000 |
commit | 0a5045ec8e38593c53647fe82d8ccc8f61eb66b8 (patch) | |
tree | 8d5e64265d28f159c45c37c5990daeac5a429a4b | |
parent | 45dcdc394866e10deea6117c474cd430f650a618 (diff) | |
download | nextcloud-server-0a5045ec8e38593c53647fe82d8ccc8f61eb66b8.tar.gz nextcloud-server-0a5045ec8e38593c53647fe82d8ccc8f61eb66b8.zip |
Change free space calculation
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
-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 db6fa35e85c..d6c0644ccef 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; |