php-clamav icon indicating copy to clipboard operation
php-clamav copied to clipboard

Throw an error in fileScan() in case of ClamAV error rather than returning `true`

Open perk11 opened this issue 6 months ago • 0 comments

I've had an issue where a mount wasn't working in a docker container with ClamAV, so SCAN command was returning something like this: /clamav_tmp/file.docx: File path check failure: No such file or directory

I've been using fileScan() in php-clamav and since it did not find 'OK' in ClamAV output, it returned true which led to all files scanned being silently marked as having a virus.

I think this should instead have caused an Exception, so that it's clear that there is an issue with the scanning.

perk11 avatar Oct 31 '25 01:10 perk11