Check file name end with .xml
This commit is contained in:
parent
08ded970e2
commit
de4d5f3888
@ -1661,10 +1661,14 @@ class Setup extends DolibarrApi
|
|||||||
if (empty($xmlremote)) {
|
if (empty($xmlremote)) {
|
||||||
$xmlremote = 'https://www.dolibarr.org/files/stable/signatures/filelist-'.DOL_VERSION.'.xml';
|
$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");
|
$langs->load("errors");
|
||||||
throw new RestException(500, $langs->trans("ErrorURLMustStartWithHttp", $xmlremote));
|
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 ($target == 'local') {
|
||||||
if (dol_is_file($xmlfile)) {
|
if (dol_is_file($xmlfile)) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user