]> source.dussan.org Git - nextcloud-server.git/commitdiff
don't create empty versions
authorBjoern Schiessle <schiessle@owncloud.com>
Tue, 30 Jul 2013 14:01:27 +0000 (16:01 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Thu, 8 Aug 2013 15:25:50 +0000 (17:25 +0200)
apps/files_versions/lib/versions.php

index c083a000c37b21f68b7747ce1bd44bbf17bcd5a4..10d6f7ef421a3ebb444fe14685b47553e11e733e 100644 (file)
@@ -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;
                        }