aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_trashbin/lib/Trashbin.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php
index 1cf3e683543..a06a5145d99 100644
--- a/apps/files_trashbin/lib/Trashbin.php
+++ b/apps/files_trashbin/lib/Trashbin.php
@@ -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)) {