From 609649557b87aa7281e7870e9a23733cce6ed1c9 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 31 May 2017 03:46:43 +0000 Subject: [PATCH] Better handling of timeout issues while probing --- src/Network/Probe.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/Network/Probe.php b/src/Network/Probe.php index 94fa2733be..531fdfef64 100644 --- a/src/Network/Probe.php +++ b/src/Network/Probe.php @@ -123,13 +123,13 @@ class Probe { } if (!is_object($xrd)) { logger("No xrd object found for ".$host, LOGGER_DEBUG); - return false; + return array(); } $links = xml::element_to_array($xrd); if (!isset($links["xrd"]["link"])) { logger("No xrd data found for ".$host, LOGGER_DEBUG); - return false; + return array(); } $xrd_data = array(); @@ -222,6 +222,10 @@ class Probe { $lrdd = self::xrd($uri); $webfinger = null; + if (is_bool($lrdd)) { + return array(); + } + if (!$lrdd) { $parts = @parse_url($uri); if (!$parts) { @@ -424,6 +428,10 @@ class Probe { } $lrdd = self::xrd($host); + if (is_bool($lrdd)) { + return array(); + } + $path_parts = explode("/", trim($parts["path"], "/")); while (!$lrdd AND (sizeof($path_parts) > 1)) { @@ -462,6 +470,10 @@ class Probe { } $lrdd = self::xrd($host); + if (is_bool($lrdd)) { + return array(); + } + if (!$lrdd) { logger('No XRD data was found for '.$uri, LOGGER_DEBUG); return self::mail($uri, $uid); -- 2.39.5