We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit a7e74847 authored by mattl's avatar mattl

Fixed regression in OStatus sub from WebFinger/XML_XRD update

XML_XRD::getAll requires arguments (at least relation). If one really
want all links, just get the 'links' array. It's public!

Also, not all XML_XRD_Element_Link were migrated from the previous
array style.
parent cced063e
......@@ -180,7 +180,11 @@ class OStatusInitAction extends Action
$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);
}
......
......@@ -92,7 +92,11 @@ class OStatusTagAction extends OStatusInitAction
$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);
}
......
......@@ -24,7 +24,7 @@ class DiscoveryHints {
{
$hints = array();
foreach ($xrd->getAll() as $link) {
foreach ($xrd->links as $link) {
switch ($link->rel) {
case WebFinger::PROFILEPAGE:
$hints['profileurl'] = $link->href;
......
......@@ -59,12 +59,12 @@ class MagicEnvelope
$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];
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment