Skip to content

Commit

Permalink
Horde_Crypt_Pgp_Keyserver expects a Horde_Crypt_Pgp object
Browse files Browse the repository at this point in the history
so we must at least implement the expected interface.
  • Loading branch information
mrubinsk committed Apr 15, 2015
1 parent 9cc7eb1 commit 21887e2
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions imp/lib/Pgp.php
Expand Up @@ -749,16 +749,6 @@ public function prettyKey($pgpdata)

$fingerprints = $this->_pgp->getFingerprintsFromKey($pgpdata);

$getKeyIdString = function($keyid) {
/* Get the 8 character key ID string. */
if (strpos($keyid, '0x') === 0) {
$keyid = substr($keyid, 2);
}
if (strlen($keyid) > 8) {
$keyid = substr($keyid, -8);
}
return '0x' . $keyid;
};

/* Making the property names the same width for all localizations .*/
$leftrow = array(
Expand Down Expand Up @@ -794,7 +784,7 @@ function (&$s, $k, $m) {

$keyid = empty($key['keyid'])
? null
: $getKeyIdString($key['keyid']);
: $this->getKeyIdString($key['keyid']);
$fingerprint = isset($fingerprints[$keyid])
? $fingerprints[$keyid]
: null;
Expand All @@ -815,6 +805,18 @@ function (&$s, $k, $m) {
return $msg;
}

public function getKeyIdString($keyid)
{
/* Get the 8 character key ID string. */
if (strpos($keyid, '0x') === 0) {
$keyid = substr($keyid, 2);
}
if (strlen($keyid) > 8) {
$keyid = substr($keyid, -8);
}
return '0x' . $keyid;
}

/**
* Return list of keyserver objects.
*
Expand Down

0 comments on commit 21887e2

Please sign in to comment.