summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2013-07-30 16:01:27 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2013-07-30 16:01:27 +0200
commit853b106bb282684534c64681d1b03d1d6de7513c (patch)
tree459fc6fc725acf402e116880efebd6827bd02770 /apps/files_versions
parent10939b0bdfed1474840fbf43e0cff0ef74f7846f (diff)
downloadnextcloud-server-853b106bb282684534c64681d1b03d1d6de7513c.tar.gz
nextcloud-server-853b106bb282684534c64681d1b03d1d6de7513c.zip
don't create empty versions
Diffstat (limited to 'apps/files_versions')
-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;
}