]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fixed regression in OStatus sub from WebFinger/XML_XRD update
authorMikael Nordfeldth <mmn@hethane.se>
Mon, 30 Sep 2013 21:12:35 +0000 (23:12 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 30 Sep 2013 21:33:28 +0000 (23:33 +0200)
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.

plugins/OStatus/actions/ostatusinit.php
plugins/OStatus/actions/ostatustag.php
plugins/OStatus/lib/discoveryhints.php
plugins/OStatus/lib/magicenvelope.php

index d8b3fdec51832d36f7fdac3f28b9b67c567ef1e1..b31320b44483a12660ef535b301122f121b84ace 100644 (file)
@@ -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);
         }
index 7a3be739c7fe295d078b1417602bda755fe86847..e81c97b5ab809237235c5c087ce678d8b3ce08da 100644 (file)
@@ -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);
         }
index ab0586dac0808769cb5fabd55effc3b814fa41a0..a868e73922f1a6d5800f52096db6b00e5c6bef41 100644 (file)
@@ -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;
index a6a60bfa37ddcbbea2bf7d4a70544f4a6c780d58..e97eb2be2ca64be8e4894481fff61265f25341fb 100644 (file)
@@ -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];
                 }