mirror of
https://github.com/friendica/friendica
synced 2025-04-28 12:24:23 +02:00
Merge pull request #12736 from MrPetovan/bug/12733-webfinger-apcontact
Replace custom WebFinger implementation by Probe::getWebfingerArray in APContact::fetchWebfingerData
This commit is contained in:
commit
1d7d6fe35c
2 changed files with 16 additions and 16 deletions
|
@ -71,21 +71,14 @@ class APContact
|
|||
return $data;
|
||||
}
|
||||
|
||||
$data = ['addr' => $addr];
|
||||
$template = 'https://' . $addr_parts[1] . '/.well-known/webfinger?resource=acct:' . urlencode($addr);
|
||||
$webfinger = Probe::webfinger(str_replace('{uri}', urlencode($addr), $template), HttpClientAccept::JRD_JSON);
|
||||
if (empty($webfinger['links'])) {
|
||||
$template = 'http://' . $addr_parts[1] . '/.well-known/webfinger?resource=acct:' . urlencode($addr);
|
||||
$webfinger = Probe::webfinger(str_replace('{uri}', urlencode($addr), $template), HttpClientAccept::JRD_JSON);
|
||||
if (empty($webfinger['links'])) {
|
||||
return [];
|
||||
}
|
||||
$data['baseurl'] = 'http://' . $addr_parts[1];
|
||||
} else {
|
||||
$data['baseurl'] = 'https://' . $addr_parts[1];
|
||||
$webfinger = Probe::getWebfingerArray($addr);
|
||||
if (empty($webfinger['webfinger']['links'])) {
|
||||
return [];
|
||||
}
|
||||
|
||||
foreach ($webfinger['links'] as $link) {
|
||||
$data['baseurl'] = $webfinger['baseurl'];
|
||||
|
||||
foreach ($webfinger['webfinger']['links'] as $link) {
|
||||
if (empty($link['rel'])) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue