2
0
forked from Wavyzz/dolibarr

Check file name end with .xml

This commit is contained in:
Laurent Destailleur
2021-04-19 15:07:07 +02:00
parent 08ded970e2
commit de4d5f3888

View File

@@ -1661,10 +1661,14 @@ class Setup extends DolibarrApi
if (empty($xmlremote)) {
$xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
}
if ($xmlremote && !preg_match('/^https?:\/\//', $xmlremote)) {
if ($xmlremote && !preg_match('/^https?:\/\//i', $xmlremote)) {
$langs->load("errors");
throw new RestException(500, $langs->trans("ErrorURLMustStartWithHttp", $xmlremote));
}
if ($xmlremote && !preg_match('/\.xml$/', $xmlremote)) {
$langs->load("errors");
throw new RestException(500, $langs->trans("ErrorURLMustEndWith", '.xml'));
}
if ($target == 'local') {
if (dol_is_file($xmlfile)) {