aboutsummaryrefslogtreecommitdiffstats
path: root/include/network.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2020-06-14 15:39:00 +0200
committerMario Vavti <mario@mariovavti.com>2020-06-14 15:39:00 +0200
commit7270da6a28f836f94f6d98557df9532e587c3646 (patch)
tree86bc0a8d3956ae4bff86dcbb96bb3b88b68e5daa /include/network.php
parent8cd66145bdd8bf0f43c2a1774181c974335fc494 (diff)
parent92ee27349cb62e0a78f25686c3fe64cd8dd4130c (diff)
downloadvolse-hubzilla-7270da6a28f836f94f6d98557df9532e587c3646.tar.gz
volse-hubzilla-7270da6a28f836f94f6d98557df9532e587c3646.tar.bz2
volse-hubzilla-7270da6a28f836f94f6d98557df9532e587c3646.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'include/network.php')
-rw-r--r--include/network.php48
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);