mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-06 01:28:19 +01:00
Clean code
This commit is contained in:
@@ -2060,10 +2060,15 @@ class Setup extends DolibarrApi
|
||||
$file_list = array('missing' => array(), 'updated' => array());
|
||||
|
||||
// Local file to compare to
|
||||
$xmlshortfile = dol_sanitizeFileName(GETPOST('xmlshortfile', 'alpha') ? GETPOST('xmlshortfile', 'alpha') : 'filelist-'.DOL_VERSION.(!getDolGlobalString('MAIN_FILECHECK_LOCAL_SUFFIX') ? '' : $conf->global->MAIN_FILECHECK_LOCAL_SUFFIX).'.xml'.(!getDolGlobalString('MAIN_FILECHECK_LOCAL_EXT') ? '' : $conf->global->MAIN_FILECHECK_LOCAL_EXT));
|
||||
$xmlshortfile = dol_sanitizeFileName('filelist-'.DOL_VERSION.getDolGlobalString('MAIN_FILECHECK_LOCAL_SUFFIX').'.xml'.getDolGlobalString('MAIN_FILECHECK_LOCAL_EXT'));
|
||||
|
||||
$xmlfile = DOL_DOCUMENT_ROOT.'/install/'.$xmlshortfile;
|
||||
if (!preg_match('/\.zip$/i', $xmlfile) && dol_is_file($xmlfile.'.zip')) {
|
||||
$xmlfile = $xmlfile.'.zip';
|
||||
}
|
||||
|
||||
// Remote file to compare to
|
||||
$xmlremote = ($target == 'default' ? '' : $target);
|
||||
$xmlremote = (($target == 'default' || $target == 'local') ? '' : $target);
|
||||
if (empty($xmlremote) && getDolGlobalString('MAIN_FILECHECK_URL')) {
|
||||
$xmlremote = getDolGlobalString('MAIN_FILECHECK_URL');
|
||||
}
|
||||
@@ -2093,7 +2098,7 @@ class Setup extends DolibarrApi
|
||||
if (dol_is_file($xmlfile)) {
|
||||
$xml = simplexml_load_file($xmlfile);
|
||||
} else {
|
||||
throw new RestException(500, $langs->trans('XmlNotFound').': '.$xmlfile);
|
||||
throw new RestException(500, $langs->trans('XmlNotFound').': /install/'.$xmlshortfile);
|
||||
}
|
||||
} else {
|
||||
$xmlarray = getURLContent($xmlremote, 'GET', '', 1, array(), array('http', 'https'), 0); // Accept http or https links on external remote server only. Same is used into filecheck.php.
|
||||
|
||||
Reference in New Issue
Block a user