dont try to copy trash items to user if the user has not enough free space

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2019-07-25 03:25:12 +02:00
parent 80b71ddbfa
commit fafce34aa0
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB

View File

@ -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)) {