]> git.mxchange.org Git - friendica.git/commitdiff
Hubzilla doesn't return the handle in the hcard
authorMichael <heluecht@pirati.ca>
Fri, 27 Oct 2017 06:17:24 +0000 (06:17 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 27 Oct 2017 06:17:24 +0000 (06:17 +0000)
include/diaspora.php
mod/xrd.php
src/Network/Probe.php

index af014c47fe1cd71a0d083892974200faf9c33210..ecaf28df8c0bb0c41fd200c81490665a13d83da6 100644 (file)
@@ -1134,7 +1134,8 @@ class Diaspora {
                        return false;
 
                // This will work for new Diaspora servers and Friendica servers from 3.5
-               $source_url = $server."/fetch/post/".$guid;
+               $source_url = $server."/fetch/post/".urlencode($guid);
+
                logger("Fetch post from ".$source_url, LOGGER_DEBUG);
 
                $envelope = fetch_url($source_url);
@@ -1150,7 +1151,7 @@ class Diaspora {
 
                // This will work for older Diaspora and Friendica servers
                if (!$x) {
-                       $source_url = $server."/p/".$guid.".xml";
+                       $source_url = $server."/p/".urlencode($guid).".xml";
                        logger("Fetch post from ".$source_url, LOGGER_DEBUG);
 
                        $x = fetch_url($source_url);
index a1adc8ac2cb8dfcd4cffd60af7ac80a5529bf539..ca6c02b6a2f01cfdd1d33d9871806f2b51250891 100644 (file)
@@ -24,7 +24,7 @@ function xrd_init(App $a) {
 
        if(substr($uri,0,4) === 'http') {
                $acct = false;
-               $name = basename($uri);
+               $name = ltrim(basename($uri), '~');
        } else {
                $acct = true;
                $local = str_replace('acct:', '', $uri);
index d27ce18512847eedc337c6e18b04da1b241f4084..30b197f5b6fb2308f37b4d1a56ac47040aaa4269 100644 (file)
@@ -1093,7 +1093,6 @@ class Probe {
         * @return array Diaspora data
         */
        private static function diaspora($webfinger) {
-
                $hcard_url = "";
                $data = array();
                foreach ($webfinger["links"] as $link) {
@@ -1129,6 +1128,8 @@ class Probe {
                        foreach ($webfinger["aliases"] as $alias) {
                                if (normalise_link($alias) != normalise_link($data["url"]) && ! strstr($alias, "@")) {
                                        $data["alias"] = $alias;
+                               } elseif (substr($alias, 0, 5) == 'acct:') {
+                                       $data["addr"] = substr($alias, 5);
                                }
                        }
                }