From: Bjoern Schiessle Date: Tue, 30 Jul 2013 14:01:27 +0000 (+0200) Subject: don't create empty versions X-Git-Tag: v6.0.0alpha2~342^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=853b106bb282684534c64681d1b03d1d6de7513c;p=nextcloud-server.git don't create empty versions --- diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index 7c75d70f79c..70b8f30be5c 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -101,8 +101,11 @@ class Storage { return false; } - // we should have a source file to work with - if (!$files_view->file_exists($filename)) { + // we should have a source file to work with, and the file shouldn't + // be empty + $fileExists = $files_view->file_exists($filename); + $fileSize = $files_view->filesize($filename); + if ($fileExists === false || $fileSize === 0) { return false; }