]> git.mxchange.org Git - friendica.git/blobdiff - src/Network/Probe.php
Merge remote-tracking branch 'upstream/2022.05-rc' into ap-endpoint-cache
[friendica.git] / src / Network / Probe.php
index 82d608f2c4f7190575b0e753bef545ec77eddc44..c5ecf96ed3746d884072d3de29ab0fffaf00527f 100644 (file)
@@ -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
         *