diff options
author | mrjive <mrjive@mrjive.it> | 2015-09-21 15:41:17 +0200 |
---|---|---|
committer | mrjive <mrjive@mrjive.it> | 2015-09-21 15:41:17 +0200 |
commit | 49d11ed9f88531bcd03f2f129230b0352014c22c (patch) | |
tree | 1f21f01874913a3f5f1f86bdc857dccc143f6a3b /include/network.php | |
parent | 024af91df82b4bb14983c53ae319ba9d348773d6 (diff) | |
parent | d2565d0f61c139df6536ec9d90c10d7af29ef9e5 (diff) | |
download | volse-hubzilla-49d11ed9f88531bcd03f2f129230b0352014c22c.tar.gz volse-hubzilla-49d11ed9f88531bcd03f2f129230b0352014c22c.tar.bz2 volse-hubzilla-49d11ed9f88531bcd03f2f129230b0352014c22c.zip |
Merge pull request #2 from redmatrix/master
get fresh code from HZ base
Diffstat (limited to 'include/network.php')
-rw-r--r-- | include/network.php | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/include/network.php b/include/network.php index d3320f3ee..41e1ff37c 100644 --- a/include/network.php +++ b/include/network.php @@ -1053,16 +1053,20 @@ function discover_by_webbie($webbie) { $webbie = strtolower($webbie); - $x = webfinger_rfc7033($webbie); + $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) && $link['rel'] == 'http://purl.org/zot/protocol') { logger('discover_by_webbie: zot found for ' . $webbie, LOGGER_DEBUG); - $z = z_fetch_url($link['href']); - if($z['success']) { - $j = json_decode($z['body'],true); - $i = import_xchan($j); - return true; + if(array_key_exists('zot',$x) && $x['zot']['success']) + $i = import_xchan($x['zot']); + else { + $z = z_fetch_url($link['href']); + if($z['success']) { + $j = json_decode($z['body'],true); + $i = import_xchan($j); + return true; + } } } } @@ -1282,7 +1286,7 @@ LSIeXnd14lQYK/uxW/8cTFjcmddsKxeXysoQxbSa9VdDK+KkpZdgYXYrTTofXs6v+ } -function webfinger_rfc7033($webbie) { +function webfinger_rfc7033($webbie,$zot = false) { if(! strpos($webbie,'@')) @@ -1292,7 +1296,7 @@ function webfinger_rfc7033($webbie) { $resource = 'acct:' . $webbie; - $s = z_fetch_url('https://' . $rhs . '/.well-known/webfinger?resource=' . $resource); + $s = z_fetch_url('https://' . $rhs . '/.well-known/webfinger?f=&resource=' . $resource . (($zot) ? '&zot=1' : '')); if($s['success']) $j = json_decode($s['body'],true); |