diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php
index cc48a57ee41..7fcfcdd5e49 100644
--- a/htdocs/admin/mails.php
+++ b/htdocs/admin/mails.php
@@ -77,7 +77,8 @@ if ($_POST['addfile'] || $_POST['addfilehtml'])
if (is_dir($upload_dir))
{
- if (dol_move_uploaded_file($_FILES['addedfile']['tmp_name'], $upload_dir . "/" . $_FILES['addedfile']['name'],0) > 0)
+ $result = dol_move_uploaded_file($_FILES['addedfile']['tmp_name'], $upload_dir . "/" . $_FILES['addedfile']['name'],0);
+ if ($result > 0)
{
$message = '
'.$langs->trans("FileTransferComplete").'
';
//print_r($_FILES);
@@ -86,10 +87,16 @@ if ($_POST['addfile'] || $_POST['addfilehtml'])
$formmail = new FormMail($db);
$formmail->add_attached_files($upload_dir . "/" . $_FILES['addedfile']['name'],$_FILES['addedfile']['name'],$_FILES['addedfile']['type']);
}
- else
+ else if ($result == -99)
+ {
+ // Files infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
+ }
+ else if ($result < 0)
{
// Echec transfert (fichier depassant la limite ?)
- $message = ''.$langs->trans("ErrorFileNotUploaded").'
';
+ $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
// print_r($_FILES);
}
}
diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php
index 7d02153857d..394d826abab 100644
--- a/htdocs/admin/security_other.php
+++ b/htdocs/admin/security_other.php
@@ -53,9 +53,9 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
}
else if (is_numeric($resupload) && $resupload == -99)
{
- // Echec transfert (virus ?)
- $mesg = ''.$langs->trans("ErrorFileIsInfectedWith");
- $mesg.= '
';
+ // File infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
}
else
{
diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php
index 66576f8cef9..1b6c9ba80ab 100755
--- a/htdocs/comm/action/document.php
+++ b/htdocs/comm/action/document.php
@@ -77,17 +77,24 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
if (is_dir($upload_dir))
{
- if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0) > 0)
+ $result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0);
+ if ($result > 0)
{
$mesg = ''.$langs->trans("FileTransferComplete").'
';
//print_r($_FILES);
}
- else
+ else if ($result == -99)
{
- // Echec transfert (fichier depassant la limite ?)
- $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
- // print_r($_FILES);
+ // Files infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
}
+ else if ($result < 0)
+ {
+ // Echec transfert (fichier depassant la limite ?)
+ $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
+ // print_r($_FILES);
+ }
}
}
diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php
index 28e3ae29f7d..faaf0e358ae 100644
--- a/htdocs/comm/propal.php
+++ b/htdocs/comm/propal.php
@@ -377,7 +377,8 @@ if ($_POST['addfile'])
if (is_dir($upload_dir))
{
- if (dol_move_uploaded_file($_FILES['addedfile']['tmp_name'], $upload_dir . "/" . $_FILES['addedfile']['name'],0) > 0)
+ $result = dol_move_uploaded_file($_FILES['addedfile']['tmp_name'], $upload_dir . "/" . $_FILES['addedfile']['name'],0);
+ if ($result > 0)
{
$mesg = ''.$langs->trans("FileTransferComplete").'
';
//print_r($_FILES);
@@ -387,7 +388,13 @@ if ($_POST['addfile'])
// Add file in list of files in session
$formmail->add_attached_files($upload_dir . "/" . $_FILES['addedfile']['name'],$_FILES['addedfile']['name'],$_FILES['addedfile']['type']);
}
- else
+ else if ($result == -99)
+ {
+ // Files infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
+ }
+ else if ($result < 0)
{
// Echec transfert (fichier depassant la limite ?)
$mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php
index 6900369691a..18657669bf3 100644
--- a/htdocs/comm/propal/document.php
+++ b/htdocs/comm/propal/document.php
@@ -77,17 +77,24 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
if (is_dir($upload_dir))
{
- if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0) > 0)
- {
- $mesg = ''.$langs->trans("FileTransferComplete").'
';
- //print_r($_FILES);
- }
- else
- {
- // Echec transfert (fichier d�passant la limite ?)
- $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
- // print_r($_FILES);
- }
+ $result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0);
+ if ($result > 0)
+ {
+ $mesg = ''.$langs->trans("FileTransferComplete").'
';
+ //print_r($_FILES);
+ }
+ else if ($result == -99)
+ {
+ // Files infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
+ }
+ else if ($result < 0)
+ {
+ // Echec transfert (fichier depassant la limite ?)
+ $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
+ // print_r($_FILES);
+ }
}
}
}
diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php
index dbe0e2422fd..2c331af848c 100644
--- a/htdocs/commande/document.php
+++ b/htdocs/commande/document.php
@@ -80,16 +80,23 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
if (is_dir($upload_dir))
{
- if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0) > 0)
+ $result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0);
+ if ($result > 0)
+ {
+ $mesg = ''.$langs->trans("FileTransferComplete").'
';
+ //print_r($_FILES);
+ }
+ else if ($result == -99)
+ {
+ // Files infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
+ }
+ else if ($result < 0)
{
- $mesg = ''.$langs->trans("FileTransferComplete").'
';
- //print_r($_FILES);
- }
- else
- {
- // Echec transfert (fichier dépassant la limite ?)
- $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
- // print_r($_FILES);
+ // Echec transfert (fichier depassant la limite ?)
+ $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
+ // print_r($_FILES);
}
}
}
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index d0af6bceb15..83549b117d5 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -717,7 +717,8 @@ if ($_POST['addfile'])
if (is_dir($upload_dir))
{
- if (dol_move_uploaded_file($_FILES['addedfile']['tmp_name'], $upload_dir . "/" . $_FILES['addedfile']['name'],0) > 0)
+ $result = dol_move_uploaded_file($_FILES['addedfile']['tmp_name'], $upload_dir . "/" . $_FILES['addedfile']['name'],0);
+ if ($result > 0)
{
$mesg = ''.$langs->trans("FileTransferComplete").'
';
//print_r($_FILES);
@@ -726,7 +727,13 @@ if ($_POST['addfile'])
$formmail = new FormMail($db);
$formmail->add_attached_files($upload_dir . "/" . $_FILES['addedfile']['name'],$_FILES['addedfile']['name'],$_FILES['addedfile']['type']);
}
- else
+ else if ($result == -99)
+ {
+ // Files infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
+ }
+ else if ($result < 0)
{
// Echec transfert (fichier depassant la limite ?)
$mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index b74cb8d96d5..d302439139b 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -1140,7 +1140,8 @@ if ($_POST['addfile'])
if (is_dir($upload_dir))
{
- if (dol_move_uploaded_file($_FILES['addedfile']['tmp_name'], $upload_dir . "/" . $_FILES['addedfile']['name'],0) > 0)
+ $result = dol_move_uploaded_file($_FILES['addedfile']['tmp_name'], $upload_dir . "/" . $_FILES['addedfile']['name'],0);
+ if ($result > 0)
{
$mesg = ''.$langs->trans("FileTransferComplete").'
';
//print_r($_FILES);
@@ -1149,7 +1150,13 @@ if ($_POST['addfile'])
$formmail = new FormMail($db);
$formmail->add_attached_files($upload_dir . "/" . $_FILES['addedfile']['name'],$_FILES['addedfile']['name'],$_FILES['addedfile']['type']);
}
- else
+ else if ($result == -99)
+ {
+ // Files infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
+ }
+ else if ($result < 0)
{
// Echec transfert (fichier depassant la limite ?)
$mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php
index 193ad718d41..60bdbf4d235 100644
--- a/htdocs/compta/facture/document.php
+++ b/htdocs/compta/facture/document.php
@@ -79,16 +79,23 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
if (is_dir($upload_dir))
{
- if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0) > 0)
+ $result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0);
+ if ($result > 0)
{
- $mesg = ''.$langs->trans("FileTransferComplete").'
';
- //print_r($_FILES);
+ $mesg = ''.$langs->trans("FileTransferComplete").'
';
+ //print_r($_FILES);
}
- else
+ else if ($result == -99)
{
- // Echec transfert (fichier d�passant la limite ?)
- $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
- // print_r($_FILES);
+ // Files infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
+ }
+ else if ($result < 0)
+ {
+ // Echec transfert (fichier depassant la limite ?)
+ $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
+ // print_r($_FILES);
}
}
}
diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php
index 5e14606438a..a2fbe03153d 100644
--- a/htdocs/contrat/document.php
+++ b/htdocs/contrat/document.php
@@ -73,23 +73,30 @@ $modulepart='contract';
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
/*
- * Creation r�pertoire si n'existe pas
+ * Creation repertoire si n'existe pas
*/
if (! is_dir($upload_dir)) create_exdir($upload_dir);
if (is_dir($upload_dir))
{
- if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0) > 0)
+ $result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0);
+ if ($result > 0)
{
$mesg = ''.$langs->trans("FileTransferComplete").'
';
//print_r($_FILES);
}
- else
+ else if ($result == -99)
{
- // Echec transfert (fichier d�passant la limite ?)
- $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
- // print_r($_FILES);
+ // Files infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
}
+ else if ($result < 0)
+ {
+ // Echec transfert (fichier depassant la limite ?)
+ $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
+ // print_r($_FILES);
+ }
}
}
diff --git a/htdocs/ecm/docmine.php b/htdocs/ecm/docmine.php
index 557d603d145..e9bf095ef06 100644
--- a/htdocs/ecm/docmine.php
+++ b/htdocs/ecm/docmine.php
@@ -105,6 +105,12 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
//print_r($_FILES);
$result=$ecmdir->changeNbOfFiles('+');
}
+ else if ($result == -99)
+ {
+ // File infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
+ }
else if ($result < 0)
{
// Echec transfert (fichier depassant la limite ?)
@@ -112,12 +118,6 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
$mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
// print_r($_FILES);
}
- else
- {
- // File infected by a virus
- $langs->load("errors");
- $mesg = ''.$langs->trans("ErrorFileIsInfectedWith",$result).'
';
- }
}
else
{
diff --git a/htdocs/ecm/docother.php b/htdocs/ecm/docother.php
index f78e37b6844..ce2a2400018 100644
--- a/htdocs/ecm/docother.php
+++ b/htdocs/ecm/docother.php
@@ -56,17 +56,18 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
$mesg = ''.$langs->trans("FileTransferComplete").'
';
//print_r($_FILES);
}
+ else if ($result == -99)
+ {
+ // File infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
+ }
else if ($result < 0)
{
// Echec transfert (fichier d?passant la limite ?)
$mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
// print_r($_FILES);
}
- else
- {
- // Fichier infect? par un virus
- $mesg = ''.$langs->trans("ErrorFileIsInfectedWith",$result).'
';
- }
}
}
diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php
index d4c0be6e148..41b59536a69 100644
--- a/htdocs/ecm/index.php
+++ b/htdocs/ecm/index.php
@@ -110,6 +110,12 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
//print_r($_FILES);
$result=$ecmdir->changeNbOfFiles('+');
}
+ else if ($result == -99)
+ {
+ // File infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
+ }
else if ($result < 0)
{
// Echec transfert (fichier depassant la limite ?)
@@ -117,12 +123,6 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
$mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
// print_r($_FILES);
}
- else
- {
- // File infected by a virus
- $langs->load("errors");
- $mesg = ''.$langs->trans("ErrorFileIsInfectedWith",$result).'
';
- }
}
else
{
diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php
index 67fa06f4961..a6d293c698a 100644
--- a/htdocs/fichinter/document.php
+++ b/htdocs/fichinter/document.php
@@ -70,23 +70,30 @@ $modulepart='fichinter';
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
/*
- * Creation r�pertoire si n'existe pas
+ * Creation repertoire si n'existe pas
*/
if (! is_dir($upload_dir)) create_exdir($upload_dir);
if (is_dir($upload_dir))
{
- if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0) > 0)
+ $result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0);
+ if ($result > 0)
{
$mesg = ''.$langs->trans("FileTransferComplete").'
';
//print_r($_FILES);
}
- else
+ else if ($result == -99)
{
- // Echec transfert (fichier d�passant la limite ?)
- $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
- // print_r($_FILES);
+ // Files infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
}
+ else if ($result < 0)
+ {
+ // Echec transfert (fichier depassant la limite ?)
+ $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
+ // print_r($_FILES);
+ }
}
}
diff --git a/htdocs/fourn/commande/document.php b/htdocs/fourn/commande/document.php
index 759ee20c86e..f64b3f40d69 100644
--- a/htdocs/fourn/commande/document.php
+++ b/htdocs/fourn/commande/document.php
@@ -82,16 +82,23 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
if (is_dir($upload_dir))
{
- if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0) > 0)
+ $result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0);
+ if ($result > 0)
+ {
+ $mesg = ''.$langs->trans("FileTransferComplete").'
';
+ //print_r($_FILES);
+ }
+ else if ($result == -99)
+ {
+ // Files infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
+ }
+ else if ($result < 0)
{
- $mesg = ''.$langs->trans("FileTransferComplete").'
';
- //print_r($_FILES);
- }
- else
- {
- // Echec transfert (fichier dépassant la limite ?)
- $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
- // print_r($_FILES);
+ // Echec transfert (fichier depassant la limite ?)
+ $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
+ // print_r($_FILES);
}
}
}
diff --git a/htdocs/fourn/facture/document.php b/htdocs/fourn/facture/document.php
index ac5f3e9ee95..f39b56b9780 100644
--- a/htdocs/fourn/facture/document.php
+++ b/htdocs/fourn/facture/document.php
@@ -73,15 +73,22 @@ if ($_POST['sendit'] && ! empty($conf->global->MAIN_UPLOAD_DOC))
if (is_dir($upload_dir))
{
- if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . '/' . $_FILES['userfile']['name'],0) > 0)
+ $result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0);
+ if ($result > 0)
{
- $mesg = ''.$langs->trans('FileTransferComplete').'
';
+ $mesg = ''.$langs->trans("FileTransferComplete").'
';
//print_r($_FILES);
}
- else
+ else if ($result == -99)
+ {
+ // Files infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
+ }
+ else if ($result < 0)
{
// Echec transfert (fichier depassant la limite ?)
- $mesg = ''.$langs->trans('ErrorFileNotUploaded').'
';
+ $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
// print_r($_FILES);
}
}
diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php
index 06f2d657553..26b5f71716d 100644
--- a/htdocs/ftp/index.php
+++ b/htdocs/ftp/index.php
@@ -109,6 +109,12 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
//print_r($_FILES);
$result=$ecmdir->changeNbOfFiles('+');
}
+ else if ($result == -99)
+ {
+ // File infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
+ }
else if ($result < 0)
{
// Echec transfert (fichier depassant la limite ?)
@@ -116,12 +122,6 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
$mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
// print_r($_FILES);
}
- else
- {
- // File infected by a virus
- $langs->load("errors");
- $mesg = ''.$langs->trans("ErrorFileIsInfectedWith",$result).'
';
- }
}
else
{
diff --git a/htdocs/includes/modules/mailings/peche.modules.php b/htdocs/includes/modules/mailings/peche.modules.php
index bf12f764b1d..9907da043ba 100644
--- a/htdocs/includes/modules/mailings/peche.modules.php
+++ b/htdocs/includes/modules/mailings/peche.modules.php
@@ -183,6 +183,13 @@ class mailing_peche extends MailingTargets
dol_syslog(get_class($this)."::add_to_target mailing ".$cpt." targets found");
}
+ else if ($result == -99)
+ {
+ // Files infected by a virus
+ $langs->load("errors");
+ $this->error = $langs->trans("ErrorFileIsInfectedWithAVirus");
+ return -1;
+ }
else if ($result < 0)
{
// Echec transfert (fichier depassant la limite ?)
@@ -190,12 +197,6 @@ class mailing_peche extends MailingTargets
// print_r($_FILES);
return -1;
}
- else
- {
- // Fichier infecte par un virus
- $this->error = $langs->trans("ErrorFileIsInfectedWith",$result);
- return -1;
- }
}
return parent::add_to_target($mailing_id, $cibles);
diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang
index 39fafdabbea..433c8d9ffb3 100644
--- a/htdocs/langs/en_US/errors.lang
+++ b/htdocs/langs/en_US/errors.lang
@@ -57,3 +57,4 @@ ErrorContactEMail=A technical error occured. Please, contact administrator to fo
ErrorWrongValueForField=Wrong value for field number %s (value '%s' does not match regex rule %s)
ErrorsOnXLines=Errors on %s source lines
WarningsOnXLines=Warnings on %s source lines
+ErrorFileIsInfectedWithAVirus=This file is infected by a virus!
\ No newline at end of file
diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang
index dcad5461555..0dffa874465 100644
--- a/htdocs/langs/en_US/other.lang
+++ b/htdocs/langs/en_US/other.lang
@@ -16,7 +16,6 @@ ErrorFailedToChangePassword=Failed to change password
ErrorLoginDoesNotExists=User with login %s could not be found.
ErrorLoginHasNoEmail=This user has no email address. Process aborted.
ErrorBadValueForCode=Bad value types for code. Try again with a new value...
-ErrorFileIsInfectedWith=This file is infected with %s
SecurityCode=Security code
Calendar=Calendar
AddTrip=Add trip
diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang
index bb9debb16ef..a0699bd4cb0 100644
--- a/htdocs/langs/fr_FR/errors.lang
+++ b/htdocs/langs/fr_FR/errors.lang
@@ -57,4 +57,5 @@ ErrorPasswordsMustMatch=Les 2 mots de passe saisis doivent correspondre
ErrorContactEMail=Une erreur technique est apparue. Merci de contacter l'administrateur à l'email suivant %s en lui indiquant le code erreur %s dans votre message ou mieux en fournissant une copie d'écran de cette page.
ErrorWrongValueForField=Mauvaise valeur pour le champ numéro %s (la valeur '%s' ne respecte pas la règle %s)
ErrorsOnXLines=Erreurs sur %s lignes sources
-WarningsOnXLines=Alertes sur %s lignes sources
\ No newline at end of file
+WarningsOnXLines=Alertes sur %s lignes sources
+ErrorFileIsInfectedWithAVirus=Ce fichier est infecté par un virus !
\ No newline at end of file
diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang
index 7ab11e1259f..ef78223c8f7 100644
--- a/htdocs/langs/fr_FR/other.lang
+++ b/htdocs/langs/fr_FR/other.lang
@@ -16,7 +16,6 @@ ErrorFailedToChangePassword=Echec de modification du mot de passe
ErrorLoginDoesNotExists=Le compte utilisateur de login %s n'a pu être trouvé.
ErrorLoginHasNoEmail=Cet utilisateur n'a pas d'email. Impossible de continuer.
ErrorBadValueForCode=Mauvaise valeur saisie pour le code. Réessayer avec une nouvelle valeur...
-ErrorFileIsInfectedWith=Ce fichier est infecté par %s
SecurityCode=Code sécurité
Calendar=Calendrier
AddTrip=Créer déplacement
diff --git a/htdocs/product/document.php b/htdocs/product/document.php
index 9be98fe6326..d880fa6b639 100755
--- a/htdocs/product/document.php
+++ b/htdocs/product/document.php
@@ -84,17 +84,24 @@ if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
if (is_dir($upload_dir))
{
- if (dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0) > 0)
+ $result = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir . "/" . $_FILES['userfile']['name'],0);
+ if ($result > 0)
{
$mesg = ''.$langs->trans("FileTransferComplete").'
';
//print_r($_FILES);
}
- else
+ else if ($result == -99)
{
- // Echec transfert (fichier depassant la limite ?)
- $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
- // print_r($_FILES);
+ // Files infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
}
+ else if ($result < 0)
+ {
+ // Echec transfert (fichier depassant la limite ?)
+ $mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
+ // print_r($_FILES);
+ }
}
}
diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php
index 18b99892d2b..37a687bc975 100644
--- a/htdocs/societe/document.php
+++ b/htdocs/societe/document.php
@@ -83,17 +83,18 @@ if ( $_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
$mesg = ''.$langs->trans("FileTransferComplete").'
';
//print_r($_FILES);
}
+ else if ($result == -99)
+ {
+ // Files infected by a virus
+ $langs->load("errors");
+ $mesg = ''.$langs->trans("ErrorFileIsInfectedWithAVirus").'
';
+ }
else if ($result < 0)
{
// Echec transfert (fichier depassant la limite ?)
$mesg = ''.$langs->trans("ErrorFileNotUploaded").'
';
// print_r($_FILES);
}
- else
- {
- // Fichier infecte par un virus
- $mesg = ''.$langs->trans("ErrorFileIsInfectedWith",$result).'
';
- }
}
}