Merge pull request #7997 from annando/zot-aliases

Zot: Retrieve alias addresses as well
This commit is contained in:
Hypolite Petovan 2019-12-24 05:34:37 -05:00 committed by GitHub
commit 2056e6a5c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -724,8 +724,18 @@ class Probe
$zot_url = self::$baseurl . '/.well-known/zot-info?address=' . $data['addr'];
}
if (!empty($zot_url)) {
$data = self::pollZot($zot_url, $data);
if (empty($zot_url)) {
return $data;
}
$data = self::pollZot($zot_url, $data);
if (!empty($data['url']) && !empty($webfinger['aliases']) && is_array($webfinger['aliases'])) {
foreach ($webfinger['aliases'] as $alias) {
if (!strstr($alias, '@') && Strings::normaliseLink($alias) != Strings::normaliseLink($data['url'])) {
$data['alias'] = $alias;
}
}
}
return $data;