Miglioramento controlli

This commit is contained in:
Thomas Zilio 2019-02-13 12:04:36 +01:00
parent b6bc747425
commit 268501b45d
2 changed files with 3 additions and 3 deletions

View File

@ -41,7 +41,7 @@ class FatturaElettronica
if (ends_with($file, '.p7m')) {
$file = XML::decodeP7M($this->file);
if ($file !== false) {
if (!empty($file)) {
delete($this->file);
$this->file = $file;

View File

@ -70,12 +70,12 @@ class XML
$final_file = $directory.'/'.basename($file, '.p7m');
exec('openssl smime -verify -noverify -in "'.$file.'" -inform DER -out "'.$final_file.'"', $output, $cmd);
if ($cmd != 0) {
if (!file_exists($final_file)) {
self::der2smime($file);
$result = openssl_pkcs7_verify($file, PKCS7_NOVERIFY, '', [], '', $final_file);
if ($result == -1) {
if ($result == -1 || $result === false) {
return false;
}
}