mirror of
https://github.com/devcode-it/openstamanager.git
synced 2024-12-24 22:42:33 +01:00
Miglioramento controlli
This commit is contained in:
parent
b6bc747425
commit
268501b45d
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user