mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-28 02:21:06 +08:00
Resolve #1237
This commit is contained in:
parent
c60f8776f4
commit
49010a70a0
1 changed files with 2 additions and 2 deletions
|
@ -299,13 +299,13 @@ class GnuPG
|
||||||
'private' => []
|
'private' => []
|
||||||
];
|
];
|
||||||
// Public
|
// Public
|
||||||
foreach ($this->handler()->keyinfo($pattern) as $key) {
|
foreach (($this->handler()->keyinfo($pattern) ?: []) as $key) {
|
||||||
$key['can_verify'] = $key['can_sign'];
|
$key['can_verify'] = $key['can_sign'];
|
||||||
unset($key['can_sign']);
|
unset($key['can_sign']);
|
||||||
$keys['public'][] = $key;
|
$keys['public'][] = $key;
|
||||||
}
|
}
|
||||||
// Private, read https://github.com/php-gnupg/php-gnupg/issues/5
|
// Private, read https://github.com/php-gnupg/php-gnupg/issues/5
|
||||||
foreach ($this->handler()->keyinfo($pattern, 1) as $key) {
|
foreach (($this->handler()->keyinfo($pattern, 1) ?: []) as $key) {
|
||||||
$key['can_decrypt'] = $key['can_encrypt'];
|
$key['can_decrypt'] = $key['can_encrypt'];
|
||||||
unset($key['can_encrypt']);
|
unset($key['can_encrypt']);
|
||||||
$keys['private'][] = $key;
|
$keys['private'][] = $key;
|
||||||
|
|
Loading…
Reference in a new issue