From a6b8c5231cd1d654af964d77f4e6c923143b4893 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Tue, 30 Jul 2013 16:01:27 +0200 Subject: [PATCH] don't create empty versions --- apps/files_versions/lib/versions.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index c083a000c37..10d6f7ef421 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; } -- 2.39.5