From 6a486aa92b7b49a9dc03ce78fe63b12f201230b2 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 13 Feb 2018 07:10:05 +0000 Subject: [PATCH] Remove address from name --- src/Network/Probe.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Network/Probe.php b/src/Network/Probe.php index 0f9de79abd..dac01b1e53 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -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; }