Delete files that exceed trashbin size immediately

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2020-09-23 16:38:24 +02:00
parent f06f9a91b3
commit e241f14f24
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 8 additions and 0 deletions

View File

@ -304,6 +304,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;
}
$trashStorage->getUpdater()->renameFromStorage($sourceStorage, $sourceInternalPath, $trashInternalPath);
try {