Skip to content

Commit

Permalink
Fail if the virus scanner failed
Browse files Browse the repository at this point in the history
If the virus scanner failed to run correctly, fail instead of silently
continuing.
  • Loading branch information
cpeel committed Dec 12, 2020
1 parent 4ac6e5f commit edb4c3c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions base.inc
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,9 @@ function process_file_upload($formid, $workdir, $allowed_extensions=[])
if ($av_retval == 1) {
throw new UploadError("file rejected by AV scanner");
}
if ($av_retval != 0) {
throw new UploadError("error running AV scanner");
}

// was a file uploaded?
if ($_FILES[$formid]['size'] == 0) {
Expand Down

0 comments on commit edb4c3c

Please sign in to comment.