Fix #17501 : Undownloable attached file

This commit is contained in:
lmarcouiller 2021-05-05 16:48:04 +02:00
parent 799d1de830
commit ed59a8851f
2 changed files with 5 additions and 0 deletions

View File

@ -44,6 +44,10 @@ if (GETPOST('sendit', 'alpha') && !empty($conf->global->MAIN_UPLOAD_DOC)) {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("File")), null, 'errors');
}
}
if (preg_match('/__.*__/', $_FILES['userfile']['name'][$key])) {
$error++;
setEventMessages($langs->trans('ErrorWrongFileName'), null, 'errors');
}
}
if (!$error) {

View File

@ -298,3 +298,4 @@ WarningModuleXDisabledSoYouMayMissEventHere=Module %s has not been enabled. So y
ErrorActionCommPropertyUserowneridNotDefined=User's owner is required
ErrorActionCommBadType=Selected event type (id: %n, code: %s) do not exist in Event Type dictionary
CheckVersionFail=Version check fail
ErrorWrongFileName=Name of the file cannot have __SOMETHING__ in it