From fafce34aa035c420a8a30c9dc0f6a7c7c7324166 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 25 Jul 2019 03:25:12 +0200 Subject: [PATCH] dont try to copy trash items to user if the user has not enough free space Signed-off-by: Robin Appelman --- apps/files_trashbin/lib/Trashbin.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index 1cf3e683543..d37c99cdef9 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -189,7 +189,10 @@ 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); + if (($free < 0) || ($view->filesize($source) < $free)) { + self::copy_recursive($source, $target, $view); + } if ($view->file_exists($target)) {