From 3b09c05dfbfe98b608c955cc9ad0337f235e7cb7 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Mon, 15 Aug 2022 13:07:29 +0200 Subject: [PATCH] lib/Horde/Crypt/Pgp/Keyserver.php: Newer keyserver implementations URL-encode the body returned by index lookups. To handle this gracefully, we first check whether the returned body is URL-encoded and if so, urldecode() it. --- lib/Horde/Crypt/Pgp/Keyserver.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Horde/Crypt/Pgp/Keyserver.php b/lib/Horde/Crypt/Pgp/Keyserver.php index 9034096..e0d6134 100644 --- a/lib/Horde/Crypt/Pgp/Keyserver.php +++ b/lib/Horde/Crypt/Pgp/Keyserver.php @@ -175,7 +175,12 @@ public function getKeyId($address) if (strpos($response->getHeader('Content-Type'), 'text/plain') !== 0) { continue; } - $output = $response->getBody(); + $body = $response->getBody(); + if (urlencode(urldecode($body)) === $body) { + $output = urldecode($body); + } else { + $output = $body; + } } catch (Horde_Http_Exception $e) { throw new Horde_Crypt_Exception($e); }