From 340687ddda9f9c8810e3fab070b9c809ad571a56 Mon Sep 17 00:00:00 2001 From: Robert Lyon Date: Fri, 3 May 2019 14:28:27 +1200 Subject: [PATCH] Bug 1827455: Add the file info to ClamAV admin email Currently we only log it to screen / error log but not add it to admin's email behatnotneeded Change-Id: I2c092050c5b0e330d6033508d811bdb6cc15c25d Signed-off-by: Robert Lyon --- htdocs/lib/uploadmanager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/lib/uploadmanager.php b/htdocs/lib/uploadmanager.php index 5907d930ff..292e0a3241 100644 --- a/htdocs/lib/uploadmanager.php +++ b/htdocs/lib/uploadmanager.php @@ -280,8 +280,7 @@ function clam_handle_infected_file($file) { $now = date('YmdHis'); $newname = $quarantinedir .'/'. $now .'-user-'. $userid .'-infected'; if (rename($file, $newname)) { - clam_log_infected($file, $newname); - return get_string('clammovedfile'); + return clam_log_infected($file, $newname); } } if (unlink($file)) { @@ -452,4 +451,5 @@ function clam_log_infected($oldfilepath='', $newfilepath='', $userid=0) { . ((empty($newfilepath)) ? '. The file has been deleted ' : '. The file has been moved to a quarantine directory and the new path is '. $newfilepath); log_debug($errorstr); + return $errorstr; } -- GitLab