Fix upload of module zip files

This commit is contained in:
Laurent Destailleur 2024-09-07 02:13:53 +02:00
parent 7a52dd8547
commit cbdf4d3559
3 changed files with 4 additions and 4 deletions

View File

@ -177,9 +177,9 @@ if ($action == 'install' && $allowonlineinstall) {
setEventMessages($langs->trans("ErrorFileMustBeADolibarrPackage", $original_file), null, 'errors');
$error++;
}
if (!$error && !preg_match('/^(module[a-zA-Z0-9]*|theme)_.*\-([0-9][0-9\.]*)\.zip$/i', $original_file)) {
if (!$error && !preg_match('/^(module[a-zA-Z0-9]*_|theme_|).*\-([0-9][0-9\.]*)(\s\(\d+\)\s)?\.zip$/i', $original_file)) {
$langs->load("errors");
setEventMessages($langs->trans("ErrorFilenameDosNotMatchDolibarrPackageRules", $original_file, 'module_*-x.y*.zip'), null, 'errors');
setEventMessages($langs->trans("ErrorFilenameDosNotMatchDolibarrPackageRules", $original_file, 'modulename-x[.y.z].zip'), null, 'errors');
$error++;
}
if (empty($_FILES['fileinstall']['tmp_name'])) {

View File

@ -1842,7 +1842,7 @@ if (!$error && ($massaction == 'clonetasks' || ($action == 'clonetasks' && $conf
exit();
}
} else {
setEventMessages($langs->trans('ErrorNotEnougthPermission'), null, 'errors');
setEventMessages($langs->trans('NotEnoughPermissions'), null, 'errors');
}
}

View File

@ -222,7 +222,7 @@ ErrorUserNotAssignedToTask=User must be assigned to task to be able to enter tim
ErrorTaskAlreadyAssigned=Task already assigned to user
ErrorModuleFileSeemsToHaveAWrongFormat=The module package seems to have a wrong format.
ErrorModuleFileSeemsToHaveAWrongFormat2=At least one mandatory directory must exists into zip of module: <strong>%s</strong> or <strong>%s</strong>
ErrorFilenameDosNotMatchDolibarrPackageRules=The name of the module package (<strong>%s</strong>) does not match expected name syntax: <strong>%s</strong>
ErrorFilenameDosNotMatchDolibarrPackageRules=The file name of the module package (<strong>%s</strong>) does not match the expected name syntax: <strong>%s</strong>
ErrorDuplicateTrigger=Error, duplicate trigger name %s. Already loaded from %s.
ErrorNoWarehouseDefined=Error, no warehouses defined.
ErrorBadLinkSourceSetButBadValueForRef=The link you use is not valid. A 'source' for payment is defined, but value for 'ref' is not valid.