summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBjörn Schießle <bjoern@schiessle.org>2013-08-08 03:57:43 -0700
committerBjörn Schießle <bjoern@schiessle.org>2013-08-08 03:57:43 -0700
commitc2f40d2495bbfd654ddc021ac539d0f5ba1ddb5c (patch)
treee0c592ba47dc620480c54ec96bae9bc13989cc21 /apps
parent35e1d8b26507d78098994feacd5f518628b9bd22 (diff)
parent853b106bb282684534c64681d1b03d1d6de7513c (diff)
downloadnextcloud-server-c2f40d2495bbfd654ddc021ac539d0f5ba1ddb5c.tar.gz
nextcloud-server-c2f40d2495bbfd654ddc021ac539d0f5ba1ddb5c.zip
Merge pull request #4243 from owncloud/no_empty_versions
don't create empty versions
Diffstat (limited to 'apps')
-rw-r--r--apps/files_versions/lib/versions.php7
1 files changed, 5 insertions, 2 deletions
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;
}