diff options
author | Robin Appelman <robin@icewind.nl> | 2019-07-25 03:25:12 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2019-07-29 14:05:49 +0200 |
commit | fafce34aa035c420a8a30c9dc0f6a7c7c7324166 (patch) | |
tree | d4b99842f168be9110dc9d488a3e4c8bba47d15b /apps/files_trashbin | |
parent | 80b71ddbfad13ef50d89d34c0722ffaedcdc519e (diff) | |
download | nextcloud-server-fafce34aa035c420a8a30c9dc0f6a7c7c7324166.tar.gz nextcloud-server-fafce34aa035c420a8a30c9dc0f6a7c7c7324166.zip |
dont try to copy trash items to user if the user has not enough free space
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_trashbin')
-rw-r--r-- | apps/files_trashbin/lib/Trashbin.php | 5 |
1 files changed, 4 insertions, 1 deletions
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)) { |