Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-09-24 15:45:04 +0300
committerGitHub <noreply@github.com>2020-09-24 15:45:04 +0300
commit82ca70a5803d7ae4928f822c351086cd703d0e82 (patch)
treef4a96e904888aa2687a83cb6e9546be45d6ee267 /apps
parent9d67c2a233741ea4691def720f0cf755b78917f5 (diff)
parent3c47aaa2b1cc7f6045784a12edbd36fa7925fe72 (diff)
Merge pull request #23023 from nextcloud/bugfix/noid/trashbin-size-delete-immediately
Delete files that exceed trashbin size immediately
Diffstat (limited to 'apps')
-rw-r--r--apps/files_trashbin/lib/Trashbin.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php
index 276cdf4e2d9..b1e1d0600b0 100644
--- a/apps/files_trashbin/lib/Trashbin.php
+++ b/apps/files_trashbin/lib/Trashbin.php
@@ -285,6 +285,14 @@ class Trashbin {
$trashStorage->unlink($trashInternalPath);
}
+ $config = \OC::$server->getConfig();
+ $systemTrashbinSize = (int)$config->getAppValue('files_trashbin', 'trashbin_size', '-1');
+ $userTrashbinSize = (int)$config->getUserValue($owner, 'files_trashbin', 'trashbin_size', '-1');
+ $configuredTrashbinSize = ($userTrashbinSize < 0) ? $systemTrashbinSize : $userTrashbinSize;
+ if ($configuredTrashbinSize >= 0 && $sourceStorage->filesize($sourceInternalPath) >= $configuredTrashbinSize) {
+ return false;
+ }
+
$connection = \OC::$server->getDatabaseConnection();
$connection->beginTransaction();
$trashStorage->getUpdater()->renameFromStorage($sourceStorage, $sourceInternalPath, $trashInternalPath);