]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
fix invalid separator in magic-public-key XRD and matching parsing.
authorJames Walker <walkah@walkah.net>
Thu, 11 Mar 2010 19:32:22 +0000 (14:32 -0500)
committerJames Walker <walkah@walkah.net>
Thu, 11 Mar 2010 19:49:12 +0000 (14:49 -0500)
plugins/OStatus/lib/magicenvelope.php
plugins/OStatus/lib/xrdaction.php

index c927209e4bcea76c6cfe724a6b116bf266b7e9e8..9266cab5cf40351de6f7949212fc10ec061a9645 100644 (file)
@@ -59,7 +59,11 @@ class MagicEnvelope
         }
         if ($xrd->links) {
             if ($link = Discovery::getService($xrd->links, Magicsig::PUBLICKEYREL)) {
-                list($type, $keypair) = explode(';', $link['href']);
+                list($type, $keypair) = explode(',', $link['href']);
+                if (empty($keypair)) {
+                    // Backwards compatibility check for separator bug in 0.9.0
+                    list($type, $keypair) = explode(';', $link['href']);
+                }
                 return $keypair;
             }
         }
index 6881292add2a3c58afaf0fed1487aa5252eaddf0..b3c1d84530e2ce100cc92b38b3a82a25b4cfca7b 100644 (file)
@@ -91,7 +91,7 @@ class XrdAction extends Action
         }
 
         $xrd->links[] = array('rel' => Magicsig::PUBLICKEYREL,
-                              'href' => 'data:application/magic-public-key;'. $magickey->toString(false));
+                              'href' => 'data:application/magic-public-key,'. $magickey->toString(false));
 
         // TODO - finalize where the redirect should go on the publisher
         $url = common_local_url('ostatussub') . '?profile={uri}';