Supporting each other

Community forums

Welcome, Guest
Username: Password: Remember me
Report any technical problems you discover and discuss solutions.
  • Page:
  • 1

TOPIC:

v3: bug clamav antivirus check output not shown 8 years 8 months ago #3055

  • jayaich
  • jayaich's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 92
  • Thank you received: 5
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:
--- 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.

  • Page:
  • 1
Moderators: ronmjultenJohnSmith
Time to create page: 0.039 seconds
Copyright © 2024 The Xerte Project.
Xerte logo Apereo logo OSI Logo

Search