Fix: If signature is zipped, we must unzip it first

This commit is contained in:
Laurent Destailleur 2020-01-07 16:22:58 +01:00
parent 9e6fb7b2f1
commit ecdd43f770

View File

@ -127,6 +127,18 @@ if (GETPOST('target') == 'local')
{
if (dol_is_file($xmlfile))
{
// If file is a zip file (.../filelist-x.y.z.xml.zip), we uncompress it before
if (preg_match('/\.zip$/i', $xmlfile)) {
dol_mkdir($conf->admin->dir_temp);
$xmlfilenew = preg_replace('/\.zip$/i', '', $xmlfile);
$result = dol_uncompress($xmlfile, $conf->admin->dir_temp);
if (empty($result['error'])) {
$xmlfile = $conf->admin->dir_temp.'/'.basename($xmlfilenew);
} else {
print $langs->trans('FailedToUncompressFile').': '.$xmlfile;
$error++;
}
}
$xml = simplexml_load_file($xmlfile);
}
else