Merge pull request #16534 from nextcloud/trash-copy-free-space
dont try to copy trash items to user if the user has not enough free space
This commit is contained in:
commit
d744c04a86
1 changed files with 6 additions and 1 deletions
|
@ -189,7 +189,12 @@ class Trashbin {
|
|||
|
||||
$target = $user . '/files_trashbin/files/' . $targetFilename . '.d' . $timestamp;
|
||||
$source = $owner . '/files_trashbin/files/' . $sourceFilename . '.d' . $timestamp;
|
||||
self::copy_recursive($source, $target, $view);
|
||||
$free = $view->free_space($target);
|
||||
$isUnknownOrUnlimitedFreeSpace = $free < 0;
|
||||
$isEnoughFreeSpaceLeft = $view->filesize($source) < $free;
|
||||
if ($isUnknownOrUnlimitedFreeSpace || $isEnoughFreeSpaceLeft) {
|
||||
self::copy_recursive($source, $target, $view);
|
||||
}
|
||||
|
||||
|
||||
if ($view->file_exists($target)) {
|
||||
|
|
Loading…
Reference in a new issue