diff options
author | Max Kostikov <max@kostikov.co> | 2021-03-10 11:14:02 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-03-10 11:14:02 +0000 |
commit | 11d831e4d7bd4163ea518892f541252ce1acea2e (patch) | |
tree | 2971e2626503b972b5051d6f26689166e07f4d4c /include/network.php | |
parent | 7ee495624e71125074a4eb9f5533a7af2db2f6b6 (diff) | |
download | volse-hubzilla-11d831e4d7bd4163ea518892f541252ce1acea2e.tar.gz volse-hubzilla-11d831e4d7bd4163ea518892f541252ce1acea2e.tar.bz2 volse-hubzilla-11d831e4d7bd4163ea518892f541252ce1acea2e.zip |
More PHP 8 fixes
Diffstat (limited to 'include/network.php')
-rw-r--r-- | include/network.php | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/network.php b/include/network.php index f5ff48fce..fcc7b4289 100644 --- a/include/network.php +++ b/include/network.php @@ -1134,11 +1134,15 @@ function discover_by_webbie($webbie, $protocol = '') { foreach($x['links'] as $link) { if(array_key_exists('rel',$link)) { if($link['rel'] === PROTOCOL_ZOT6 && ((! $protocol) || (strtolower($protocol) === 'zot6'))) { + logger('zot6 found for ' . $webbie, LOGGER_DEBUG); $record = Zotfinger::exec($link['href']); + if (! $record) { + logger('Record not found for ' . $link['href']); + continue; + } // Check the HTTP signature - $hsig = $record['signature']; if($hsig && $hsig['signer'] === $link['href'] && $hsig['header_valid'] === true && $hsig['content_valid'] === true) $hsig_valid = true; @@ -1226,7 +1230,7 @@ function webfinger_rfc7033($webbie, $zot = false) { if($m['scheme'] !== 'https') return false; - $rhs = $m['host'] . (($m['port']) ? ':' . $m['port'] : ''); + $rhs = $m['host'] . (array_key_exists('port', $m) ? ':' . $m['port'] : ''); $resource = urlencode($webbie); } } @@ -1957,10 +1961,10 @@ function service_plink($contact, $guid) { $m = parse_url($contact['xchan_url']); if($m) { - $url = $m['scheme'] . '://' . $m['host'] . (($m['port']) ? ':' . $m['port'] : ''); + $url = $m['scheme'] . '://' . $m['host'] . (array_key_exists('port', $m) ? ':' . $m['port'] : ''); } else { - $url = 'https://' . substr($contact['xchan_addr'],strpos($contact['xchan_addr'],'@')+1); + $url = 'https://' . substr($contact['xchan_addr'], strpos($contact['xchan_addr'], '@') + 1); } $handle = substr($contact['xchan_addr'], 0, strpos($contact['xchan_addr'],'@')); |