Update apps/files_trashbin/lib/Trashbin.php

Co-Authored-By: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Robin Appelman 2019-09-04 13:06:07 +02:00 committed by GitHub
parent fafce34aa0
commit 9bf8ee701f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -190,7 +190,9 @@ class Trashbin {
$target = $user . '/files_trashbin/files/' . $targetFilename . '.d' . $timestamp; $target = $user . '/files_trashbin/files/' . $targetFilename . '.d' . $timestamp;
$source = $owner . '/files_trashbin/files/' . $sourceFilename . '.d' . $timestamp; $source = $owner . '/files_trashbin/files/' . $sourceFilename . '.d' . $timestamp;
$free = $view->free_space($target); $free = $view->free_space($target);
if (($free < 0) || ($view->filesize($source) < $free)) { $isUnknownOrUnlimitedFreeSpace = $free < 0;
$isEnoughFreeSpaceLeft = $view->filesize($source) < $free;
if ($isUnknownOrUnlimitedFreeSpace || $isEnoughFreeSpaceLeft) {
self::copy_recursive($source, $target, $view); self::copy_recursive($source, $target, $view);
} }