From ecdd43f7707351f3655e99aff2a2581e19cdf709 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 7 Jan 2020 16:22:58 +0100 Subject: [PATCH] Fix: If signature is zipped, we must unzip it first --- htdocs/admin/system/filecheck.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php index 9a530262b6e..5ee4741709c 100644 --- a/htdocs/admin/system/filecheck.php +++ b/htdocs/admin/system/filecheck.php @@ -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