diff options
author | Max Kostikov <max@kostikov.co> | 2020-07-19 14:58:19 +0200 |
---|---|---|
committer | Max Kostikov <max@kostikov.co> | 2020-07-19 14:58:19 +0200 |
commit | 5ea7196e78d08550b3ec93d3b708f915b3b0057f (patch) | |
tree | 07e5f865b6c83898d7ac508302a227509e8207fd /include/network.php | |
parent | d0c7c99d5e1eb27281431231640c7e8c019b90e1 (diff) | |
parent | fcc47e69e424635fa54b2684329623d4f7694436 (diff) | |
download | volse-hubzilla-5ea7196e78d08550b3ec93d3b708f915b3b0057f.tar.gz volse-hubzilla-5ea7196e78d08550b3ec93d3b708f915b3b0057f.tar.bz2 volse-hubzilla-5ea7196e78d08550b3ec93d3b708f915b3b0057f.zip |
Merge branch 'dev' into 'dev'
Dev sync
See merge request kostikov/core!1
Diffstat (limited to 'include/network.php')
-rw-r--r-- | include/network.php | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/include/network.php b/include/network.php index 80d19797b..aada36fba 100644 --- a/include/network.php +++ b/include/network.php @@ -1102,29 +1102,6 @@ function discover_by_webbie($webbie, $protocol = '') { $x = webfinger_rfc7033($webbie, true); if($x && array_key_exists('links',$x) && $x['links']) { - foreach($x['links'] as $link) { - if(array_key_exists('rel',$link)) { - - // If we discover zot - don't search further; grab the info and get out of - // here. - - if($link['rel'] === PROTOCOL_ZOT && ((! $protocol) || (strtolower($protocol) === 'zot'))) { - logger('zot found for ' . $webbie, LOGGER_DEBUG); - if(array_key_exists('zot',$x) && $x['zot']['success']) { - $i = import_xchan($x['zot']); - return true; - } - else { - $z = z_fetch_url($link['href']); - if($z['success']) { - $j = json_decode($z['body'],true); - $i = import_xchan($j); - return true; - } - } - } - } - } foreach($x['links'] as $link) { if(array_key_exists('rel',$link)) { @@ -1150,6 +1127,31 @@ function discover_by_webbie($webbie, $protocol = '') { } } } + + foreach($x['links'] as $link) { + if(array_key_exists('rel',$link)) { + + // If we discover zot - don't search further; grab the info and get out of + // here. + + if($link['rel'] === PROTOCOL_ZOT && ((! $protocol) || (strtolower($protocol) === 'zot'))) { + logger('zot found for ' . $webbie, LOGGER_DEBUG); + if(array_key_exists('zot',$x) && $x['zot']['success']) { + $i = import_xchan($x['zot']); + return true; + } + else { + $z = z_fetch_url($link['href']); + if($z['success']) { + $j = json_decode($z['body'],true); + $i = import_xchan($j); + return true; + } + } + } + } + } + } logger('webfinger: ' . print_r($x,true), LOGGER_DATA, LOG_INFO); |