From 00f3f5903eb57a6e141716f7a846a405551abaf4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Sep 2010 19:18:10 +0000 Subject: [PATCH] Fix: Error management --- htdocs/admin/security_other.php | 6 ++++-- htdocs/lib/antivir.class.php | 7 ++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 6697e433ce1..61f286003ec 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -64,9 +64,11 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC)) { $mesg = '
'.$langs->trans("ErrorFileNotUploaded").'
'; } - else if (preg_match('/ErrorFileIsInfectedWithAVirus/',$resupload)) // Files infected by a virus + else if (preg_match('/ErrorFileIsInfectedWithAVirus.(.*)/',$resupload,$reg)) // Files infected by a virus { - $mesg = '
'.$langs->trans("ErrorFileIsInfectedWithAVirus").'
'; + $mesg = '
'.$langs->trans("ErrorFileIsInfectedWithAVirus"); + $mesg.= '
'.$langs->trans("Information").': '.$langs->trans($reg[1]); + $mesg.= '
'; } else // Known error { diff --git a/htdocs/lib/antivir.class.php b/htdocs/lib/antivir.class.php index 20f39344ac8..692591582b8 100644 --- a/htdocs/lib/antivir.class.php +++ b/htdocs/lib/antivir.class.php @@ -50,9 +50,10 @@ class AntiVir } /** - * \brief Scan a file with antivirus - * \param file File to scan - * \return int <0 if KO (-98 if error, -99 if virus), 0 if OK + * Scan a file with antivirus. + * This function runs the command defined in setup. This antivirus command must return 0 if OK. + * @param file File to scan + * @return int <0 if KO (-98 if error, -99 if virus), 0 if OK */ function dol_avscan_file($file) {