mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
Merge pull request #23023 from nextcloud/bugfix/noid/trashbin-size-delete-immediately
Delete files that exceed trashbin size immediately
This commit is contained in:
commit
82ca70a580
1 changed files with 8 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue