Skip to content

Commit

Permalink
Merge pull request #3033 from efatsi/asset-validation-fix
Browse files Browse the repository at this point in the history
Add file_exists check in front of filesize lookup in Asset validation
  • Loading branch information
brandonkelly authored Jun 26, 2018
2 parents 0678eb4 + acd5c40 commit 5541ab6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fields/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public function validateFileSize(ElementInterface $element)
$filenames[] = $file['filename'];
}
} else {
if (filesize($file['location']) > $maxSize) {
if (file_exists($file['location']) && (filesize($file['location']) > $maxSize)) {
$filenames[] = $file['filename'];
}
}
Expand Down

0 comments on commit 5541ab6

Please # to comment.