$link = $xrd->get('http://ostatus.org/schema/1.0/subscribe');
if (!is_null($link)) {
// We found a URL - let's redirect!
- $url = Discovery::applyTemplate($link['template'], $target_profile);
+ if (!empty($link->template)) {
+ $url = Discovery::applyTemplate($link->template, $target_profile);
+ } else {
+ $url = $link->href;
+ }
common_log(LOG_INFO, "Sending remote subscriber $acct to $url");
common_redirect($url, 303);
}
$link = $xrd->get('http://ostatus.org/schema/1.0/tag');
if (!is_null($link)) {
// We found a URL - let's redirect!
- $url = Discovery::applyTemplate($link->template, $target_profile);
+ if (!empty($link->template)) {
+ $url = Discovery::applyTemplate($link->template, $target_profile);
+ } else {
+ $url = $link->href;
+ }
common_log(LOG_INFO, "Sending remote subscriber $acct to $url");
common_redirect($url, 303);
}
{
$hints = array();
- foreach ($xrd->getAll() as $link) {
+ foreach ($xrd->links as $link) {
switch ($link->rel) {
case WebFinger::PROFILEPAGE:
$hints['profileurl'] = $link->href;
$link = $xrd->get(Magicsig::PUBLICKEYREL);
if (!is_null($link)) {
$keypair = false;
- $parts = explode(',', $link['href']);
+ $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']);
+ $parts = explode(';', $link->href);
if (count($parts) == 2) {
$keypair = $parts[1];
}