Skip to content
Snippets Groups Projects
Unverified Commit d744c04a authored by Roeland Jago Douma's avatar Roeland Jago Douma Committed by GitHub
Browse files

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
parents 0e19e55e 9bf8ee70
No related branches found
No related tags found
No related merge requests found
...@@ -189,7 +189,12 @@ class Trashbin { ...@@ -189,7 +189,12 @@ 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;
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)) { if ($view->file_exists($target)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment