diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2020-09-24 14:45:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-24 14:45:04 +0200 |
commit | 82ca70a5803d7ae4928f822c351086cd703d0e82 (patch) | |
tree | f4a96e904888aa2687a83cb6e9546be45d6ee267 /apps | |
parent | 9d67c2a233741ea4691def720f0cf755b78917f5 (diff) | |
parent | 3c47aaa2b1cc7f6045784a12edbd36fa7925fe72 (diff) | |
download | nextcloud-server-82ca70a5803d7ae4928f822c351086cd703d0e82.tar.gz nextcloud-server-82ca70a5803d7ae4928f822c351086cd703d0e82.zip |
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.php | 8 |
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); |