fix error
This commit is contained in:
parent
50d525ed70
commit
6dc3b13d6c
@ -1658,7 +1658,7 @@ function dol_add_file_process($upload_dir, $allowoverwrite = 0, $donotupdatesess
|
||||
if (!empty($_FILES[$varfiles])) { // For view $_FILES[$varfiles]['error']
|
||||
dol_syslog('dol_add_file_process upload_dir='.$upload_dir.' allowoverwrite='.$allowoverwrite.' donotupdatesession='.$donotupdatesession.' savingdocmask='.$savingdocmask, LOG_DEBUG);
|
||||
$maxfilesinform = getDolGlobalInt("MAIN_SECURITY_MAX_ATTACHMENT_ON_FORMS", 10);
|
||||
if (count($_FILES[$varfiles]["name"]) > $maxfilesinform) {
|
||||
if (is_array($_FILES[$varfiles]["name"]) && count($_FILES[$varfiles]["name"]) > $maxfilesinform) {
|
||||
$langs->load("errors"); // key must be loaded because we can't rely on loading during output, we need var substitution to be done now.
|
||||
setEventMessages($langs->trans("ErrorTooMuchFileInForm", $maxfilesinform), null, "errors");
|
||||
return -1;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user