From e53e21857e6450a2d4e36a70abd3f28c46250aa6 Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Mon, 18 Apr 2022 19:24:06 +0200 Subject: [PATCH] Bugfix for #325 and log errors --- snappymail/v/0.0.0/app/libraries/snappymail/pgp/gpg.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/snappymail/v/0.0.0/app/libraries/snappymail/pgp/gpg.php b/snappymail/v/0.0.0/app/libraries/snappymail/pgp/gpg.php index b7d80121f..15cb5b4de 100644 --- a/snappymail/v/0.0.0/app/libraries/snappymail/pgp/gpg.php +++ b/snappymail/v/0.0.0/app/libraries/snappymail/pgp/gpg.php @@ -444,6 +444,9 @@ class GPG } } if (!$fingerprint) { + if (!empty($result['errors'])) { + \SnappyMail\Log::error('GPG', \implode("\n\t", $result['errors'])); + } return false; } @@ -486,7 +489,7 @@ class GPG $result = $this->exec($arguments); foreach ($result['status'] as $line) { - if (\strpos($line, 'IMPORT_RES')) { + if (false !== \strpos($line, 'IMPORT_RES')) { $line = \explode(' ', \explode('IMPORT_RES ', $line)[1]); return [ 'imported' => (int) $line[2], @@ -502,6 +505,10 @@ class GPG } } + if (!empty($result['errors'][0])) { + \SnappyMail\Log::warning('GPG', $result['errors'][0]); + } + return false; }