When a file with a virus is uploaded, the error message gives an AJAX error. The log message is:
Recoverable fatal error: Argument 3 passed to t() must be an array, string given, called in [MY_SITE]/sites/all/modules/antivirus/includes/ClamAVScanner.php on line 85 and defined in t()

I changed line #85:
drupal_set_message(t('Virus found in %file.', array('%file' => $file), 'warning'));
to
drupal_set_message(t('Virus found in %file.', array('%file' => $file)));
and the virus found message works with no errors. I'm assuming the 'error occurred while scanning..." message has the same issue.

Any suggestions as to how to fix this properly?

Comments

erikwebb’s picture

Status: Active » Needs review
StatusFileSize
new571 bytes

It looks like just a misplaced parenthesis. Can you try this patch?

jonraedeke’s picture

Thanks! I should have noticed that. Good catch.

The patch works for me. Technically, I guess this needs one more review for RTBC.

erikwebb’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.