diff --git a/htdocs/core/actions_linkedfiles.inc.php b/htdocs/core/actions_linkedfiles.inc.php index af60583118d..482f4cf1dea 100644 --- a/htdocs/core/actions_linkedfiles.inc.php +++ b/htdocs/core/actions_linkedfiles.inc.php @@ -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) { diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 6df5438de8f..cbf7214245a 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -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 \ No newline at end of file