first check if file exists before checking the files size

This commit is contained in:
Bjoern Schiessle 2013-08-17 11:57:50 +02:00
parent 837cefd8a3
commit 16efd81a0e
1 changed files with 9 additions and 10 deletions

View File

@ -104,8 +104,7 @@ class Storage {
// 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) {
if (!($fileExists && $files_view->filesize($filename) > 0)) {
return false;
}