diff options
author | Felix Nieuwenhuizen <felix@tdlrali.com> | 2019-01-26 17:23:23 +0100 |
---|---|---|
committer | Felix Nieuwenhuizen <felix@tdlrali.com> | 2019-01-26 17:23:23 +0100 |
commit | e806aa658c16fadad465504fab4aeef314832bdb (patch) | |
tree | 9d50d4b231bb14273b7fd2e07aa03f6f64b689e2 /apps/files_trashbin/lib | |
parent | a501193b49b6b1b3345277793f8b326f7c34fcee (diff) | |
download | nextcloud-server-e806aa658c16fadad465504fab4aeef314832bdb.tar.gz nextcloud-server-e806aa658c16fadad465504fab4aeef314832bdb.zip |
Fix for issue 10862: calculation of free space ignores external storage (doesn't count towards quota)
Signed-off-by: Felix Nieuwenhuizen <felix@tdlrali.com>
Diffstat (limited to 'apps/files_trashbin/lib')
-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 { |