From 67f40380511d2ccd5893eee954f3aee4afcddea6 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 2 Dec 2021 07:54:48 -0500 Subject: [PATCH] Fix URI structure condition in Probe::detect - This condition was wrongly discarding all URIs with a schemes --- src/Network/Probe.php | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/Network/Probe.php b/src/Network/Probe.php index baae0d3d31..bcbadd82f0 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -686,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)) {