Report any technical problems you discover and discuss solutions.

v3: bug clamav antivirus check output not shown

  • jayaich
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
10 years 11 months ago #3055 by jayaich
Hello,

The antivirus check captures the output from the 'exec' function. However, the output is an array corresponding to each line of output. The code currently shows it just as the array variable name, and so the output is not displayed. To correct this we need to implode the array into a string, and then display that. A patch for this is below:
Code:
--- library/Xerte/Validate/VirusScanClamAv.php.orig 2015-07-29 23:17:23.000000000 +0100 +++ library/Xerte/Validate/VirusScanClamAv.php 2015-08-20 14:57:02.014822249 +0100 @@ -43,9 +43,10 @@ return true; } else { - error_log("Virus found in file upload? $filename --- From " . __FILE__ . " - ClamAV output: {$retval} / {$output}"); - _debug("Virus found? {$retval} / {$output} (When scanning : $filename)"); - $this->messages[$retval] = "Virus found? $output"; + $output_str = implode(' ', $output); + error_log("Virus found in file upload? $filename --- From " . __FILE__ . " - ClamAV output: {$retval} / {$output_str}"); + _debug("Virus found? {$retval} / {$output_str} (When scanning : $filename)"); + $this->messages['VIRUS_FOUND'] = "Virus found? $output_str"; } } else {



John.

Please Log in or Create an account to join the conversation.

Moderators: ronmjultenJohnSmith
Time to create page: 0.116 seconds
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo