A bit safer checking in the keypair parsing
This commit is contained in:
parent
7b1b6045e6
commit
10410907a0
|
@ -59,14 +59,23 @@ class MagicEnvelope
|
|||
}
|
||||
if ($xrd->links) {
|
||||
if ($link = Discovery::getService($xrd->links, Magicsig::PUBLICKEYREL)) {
|
||||
list($type, $keypair) = explode(',', $link['href']);
|
||||
if (empty($keypair)) {
|
||||
$keypair = false;
|
||||
$parts = explode(',', $link['href']);
|
||||
if (count($parts) == 2) {
|
||||
$keypair = $parts[1];
|
||||
} else {
|
||||
// Backwards compatibility check for separator bug in 0.9.0
|
||||
list($type, $keypair) = explode(';', $link['href']);
|
||||
$parts = explode(';', $link['href']);
|
||||
if (count($parts) == 2) {
|
||||
$keypair = $parts[1];
|
||||
}
|
||||
}
|
||||
|
||||
if ($keypair) {
|
||||
return $keypair;
|
||||
}
|
||||
}
|
||||
}
|
||||
throw new Exception('Unable to locate signer public key');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user