[ActivityPub] Fix profile url handling

This commit is contained in:
Diogo Cordeiro
2020-03-28 03:13:06 +00:00
parent d24075b1c5
commit f4558e3c41
2 changed files with 8 additions and 6 deletions

View File

@@ -260,10 +260,11 @@ class Activitypub_explorer
$aprofile = new Activitypub_profile;
$aprofile->uri = $res['id'];
$aprofile->nickname = $res['preferredUsername'];
$aprofile->fullname = isset($res['name']) ? $res['name'] : null;
$aprofile->fullname = $res['name'] ?? null;
$aprofile->bio = isset($res['summary']) ? substr(strip_tags($res['summary']), 0, 1000) : null;
$aprofile->inboxuri = $res['inbox'];
$aprofile->sharedInboxuri = isset($res['endpoints']['sharedInbox']) ? $res['endpoints']['sharedInbox'] : $res['inbox'];
$aprofile->sharedInboxuri = $res['endpoints']['sharedInbox'] ?? $res['inbox'];
$aprofile->profileurl = $res['url'] ?? $aprofile->uri;
$aprofile->do_insert();
$profile = $aprofile->local_profile();