X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FOStatus%2Flib%2Fmagicenvelope.php;h=e97eb2be2ca64be8e4894481fff61265f25341fb;hb=220b51d8be61e9bd316567f3ad03fffdbc4b7526;hp=487435927d4e8616db427db858d3dc3e43db6ef6;hpb=8884a5255fb90fda67b63fa0d4252d77176337e5;p=quix0rs-gnu-social.git diff --git a/plugins/OStatus/lib/magicenvelope.php b/plugins/OStatus/lib/magicenvelope.php index 487435927d..e97eb2be2c 100644 --- a/plugins/OStatus/lib/magicenvelope.php +++ b/plugins/OStatus/lib/magicenvelope.php @@ -56,23 +56,22 @@ class MagicEnvelope } catch (Exception $e) { return false; } - if ($xrd->links) { - if ($link = Discovery::getService($xrd->links, Magicsig::PUBLICKEYREL)) { - $keypair = false; - $parts = explode(',', $link['href']); + $link = $xrd->get(Magicsig::PUBLICKEYREL); + if (!is_null($link)) { + $keypair = false; + $parts = explode(',', $link->href); + if (count($parts) == 2) { + $keypair = $parts[1]; + } else { + // Backwards compatibility check for separator bug in 0.9.0 + $parts = explode(';', $link->href); if (count($parts) == 2) { $keypair = $parts[1]; - } else { - // Backwards compatibility check for separator bug in 0.9.0 - $parts = explode(';', $link['href']); - if (count($parts) == 2) { - $keypair = $parts[1]; - } } + } - if ($keypair) { - return $keypair; - } + if ($keypair) { + return $keypair; } } // TRANS: Exception.