X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FNetwork%2FProbe.php;h=c5ecf96ed3746d884072d3de29ab0fffaf00527f;hb=a880d8b982a0df1e95106583a2235c6ff0f74eb7;hp=82d608f2c4f7190575b0e753bef545ec77eddc44;hpb=e299fc67c8809ecf1018e6680a3a5284bcf7d8d9;p=friendica.git diff --git a/src/Network/Probe.php b/src/Network/Probe.php index 82d608f2c4..c5ecf96ed3 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -68,6 +68,8 @@ class Probe // At first remove leading and trailing junk $rawUri = trim($rawUri, "@#?:/ \t\n\r\0\x0B"); + $rawUri = Network::convertToIdn($rawUri); + $uri = new Uri($rawUri); if (!$uri->getScheme()) { return $uri->__toString(); @@ -243,49 +245,6 @@ class Probe return $lrdd; } - /** - * Perform Webfinger lookup and return DFRN data - * - * Given an email style address, perform webfinger lookup and - * return the resulting DFRN profile URL, or if no DFRN profile URL - * is located, returns an OStatus subscription template (prefixed - * with the string 'stat:' to identify it as on OStatus template). - * If this isn't an email style address just return $webbie. - * Return an empty string if email-style addresses but webfinger fails, - * or if the resultant personal XRD doesn't contain a supported - * subscription/friend-request attribute. - * - * amended 7/9/2011 to return an hcard which could save potentially loading - * a lengthy content page to scrape dfrn attributes - * - * @param string $webbie Address that should be probed - * @param string $hcard_url Link to the hcard - is returned by reference - * - * @return string profile link - * @throws HTTPException\InternalServerErrorException - */ - public static function webfingerDfrn(string $webbie, string &$hcard_url) - { - $profile_link = ''; - - $links = self::lrdd($webbie); - Logger::debug('Result', ['url' => $webbie, 'links' => $links]); - if (!empty($links) && is_array($links)) { - foreach ($links as $link) { - if ($link['@attributes']['rel'] === ActivityNamespace::DFRN) { - $profile_link = $link['@attributes']['href']; - } - if (($link['@attributes']['rel'] === ActivityNamespace::OSTATUSSUB) && ($profile_link == "")) { - $profile_link = 'stat:'.$link['@attributes']['template']; - } - if ($link['@attributes']['rel'] === 'http://microformats.org/profile/hcard') { - $hcard_url = $link['@attributes']['href']; - } - } - } - return $profile_link; - } - /** * Check an URI for LRDD data *