From 7ec6df495f5e740b16d7bdca89b18a3f6bc78c80 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Thu, 24 Nov 2022 16:05:19 +0100 Subject: slight restructure --- Zotlabs/Lib/Webfinger.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/Zotlabs/Lib/Webfinger.php b/Zotlabs/Lib/Webfinger.php index 16d54010c..a0a4aef47 100644 --- a/Zotlabs/Lib/Webfinger.php +++ b/Zotlabs/Lib/Webfinger.php @@ -52,15 +52,21 @@ class Webfinger { if(strpos($resource,'http') === 0) { $m = parse_url($resource); - if($m) { - if(isset($m['scheme']) && $m['scheme'] !== 'https') { - return false; - } - self::$server = $m['host'] . ((isset($m['port'])) ? ':' . $m['port'] : ''); + + if (!$m) { + return false; } - else { + + if(isset($m['scheme']) && $m['scheme'] !== 'https') { return false; } + + if(!isset($m['host'])) { + return false; + } + + self::$server = $m['host'] . ((isset($m['port'])) ? ':' . $m['port'] : ''); + } elseif(strpos($resource,'tag:') === 0) { $arr = explode(':',$resource); // split the tag -- cgit v1.2.3