* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
-
class MagicEnvelope
{
const ENCODING = 'base64url';
} 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.
return $env['data'];
}
}
-