diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-03-01 13:22:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-01 13:22:16 +0100 |
commit | d0d1c85deffe225911c4e87b631389e056468cc6 (patch) | |
tree | e20a8251b39d8afb018fa52400dbafb09a599b26 | |
parent | fb5a2496e223528e798725335806c554b7cc28db (diff) | |
parent | 4704e719edcdb418624e93ca75592ff0cd39fa13 (diff) | |
download | nextcloud-server-d0d1c85deffe225911c4e87b631389e056468cc6.tar.gz nextcloud-server-d0d1c85deffe225911c4e87b631389e056468cc6.zip |
Merge pull request #14454 from nextcloud/feature/noid/use-node-api-for-trashbin
Use node API for trash bin with special flag for getSize()
-rw-r--r-- | apps/files_trashbin/lib/Trashbin.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index 5adbdeca6ad..1d0d5379905 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -680,10 +680,11 @@ class Trashbin { // calculate available space for trash bin // subtract size of files and current trash bin size from quota if ($softQuota) { - $files_view = new View('/' . $user . '/files'); - $rootInfo = $files_view->getFileInfo('/', false); - $free = $quota - $rootInfo['size']; // remaining free space for user - + $userFolder = \OC::$server->getUserFolder($user); + if(is_null($userFolder)) { + return 0; + } + $free = $quota - $userFolder->getSize(false); // remaining free space for user if ($free > 0) { $availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $trashbinSize; // how much space can be used for versions } else { |