]> git.mxchange.org Git - friendica.git/commitdiff
Remove address from name
authorMichael <heluecht@pirati.ca>
Tue, 13 Feb 2018 07:10:05 +0000 (07:10 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 13 Feb 2018 07:10:05 +0000 (07:10 +0000)
src/Network/Probe.php

index 0f9de79abd975e3da0d17198a5894be6a39ead92..dac01b1e53b8cc1255daf55002c093396ae55284 100644 (file)
@@ -652,7 +652,7 @@ class Probe
                        $result = self::ostatus($webfinger);
                }
                if ((!$result && ($network == "")) || ($network == NETWORK_PUMPIO)) {
-                       $result = self::pumpio($webfinger);
+                       $result = self::pumpio($webfinger, $addr);
                }
                if ((!$result && ($network == "")) || ($network == NETWORK_FEED)) {
                        $result = self::feed($uri);
@@ -676,7 +676,6 @@ class Probe
                                $result["baseurl"] = substr($result["url"], 0, $pos).$host;
                        }
                }
-
                return $result;
        }
 
@@ -1377,7 +1376,7 @@ class Probe
         *
         * @return array pump.io data
         */
-       private static function pumpio($webfinger)
+       private static function pumpio($webfinger, $addr)
        {
                $data = [];
                foreach ($webfinger["links"] as $link) {
@@ -1415,6 +1414,13 @@ class Probe
 
                $data = array_merge($data, $profile_data);
 
+               if (($addr != '') && ($data['name'] != '')) {
+                       $name = trim(str_replace($addr, '', $data['name']));
+                       if ($name != '') {
+                               $data['name'] = $name;
+                       }
+               }
+
                return $data;
        }