forked from Wavyzz/dolibarr
Check file name end with .xml
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user