X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FNetwork%2FProbe.php;h=96e4e7a7e7f1d8a49fc9a4b9ca0f7ce7d592c465;hb=322b7c856ca9ba53bd9c7da50dd5c1e3c9197d56;hp=d8c1a91530e23cae1b7dcdf19b1e534763cc86ce;hpb=f409bd70346c221e9692d43937462f73e6bc090e;p=friendica.git diff --git a/src/Network/Probe.php b/src/Network/Probe.php index d8c1a91530..96e4e7a7e7 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -1,6 +1,6 @@ getScheme()) { + return $uri->__toString(); } // Remove the URL fragment, since these shouldn't be part of any profile URL - unset($parts['fragment']); - - $URI = Network::unparseURL($parts); + $uri = $uri->withFragment(''); - return $URI; + return $uri->__toString(); } /** @@ -688,22 +686,21 @@ class Probe } $parts = parse_url($uri); - - if (empty($parts['scheme']) || !empty($parts['host']) && strstr($uri, '@')) { - // If the URI starts with "mailto:" then jump directly to the mail detection - if (strpos($uri, 'mailto:') !== false) { - $uri = str_replace('mailto:', '', $uri); - return self::mail($uri, $uid); - } - - if ($network == Protocol::MAIL) { - return self::mail($uri, $uid); - } - } else { + if (empty($parts['scheme']) && empty($parts['host']) && !strstr($parts['path'], '@')) { Logger::info('URI was not detectable', ['uri' => $uri]); return []; } + // If the URI starts with "mailto:" then jump directly to the mail detection + if (strpos($uri, 'mailto:') !== false) { + $uri = str_replace('mailto:', '', $uri); + return self::mail($uri, $uid); + } + + if ($network == Protocol::MAIL) { + return self::mail($uri, $uid); + } + Logger::info('Probing start', ['uri' => $uri]); if (!empty($ap_profile['addr']) && ($ap_profile['addr'] != $uri)) {