mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-24 08:44:02 +00:00
Update AP Helpers
This commit is contained in:
parent
84fba79f0e
commit
962e619061
1 changed files with 5 additions and 2 deletions
|
@ -403,7 +403,10 @@ class Helpers {
|
|||
return;
|
||||
}
|
||||
$domain = parse_url($res['id'], PHP_URL_HOST);
|
||||
$username = Purify::clean($res['preferredUsername']);
|
||||
$username = (string) Purify::clean($res['preferredUsername']);
|
||||
if(empty($username)) {
|
||||
return;
|
||||
}
|
||||
$remoteUsername = "@{$username}@{$domain}";
|
||||
|
||||
abort_if(!self::validateUrl($res['inbox']), 400);
|
||||
|
@ -414,7 +417,7 @@ class Helpers {
|
|||
if(!$profile) {
|
||||
$profile = new Profile;
|
||||
$profile->domain = $domain;
|
||||
$profile->username = Purify::clean($remoteUsername);
|
||||
$profile->username = (string) Purify::clean($remoteUsername);
|
||||
$profile->name = Purify::clean($res['name']) ?? 'user';
|
||||
$profile->bio = Purify::clean($res['summary']);
|
||||
$profile->sharedInbox = isset($res['endpoints']) && isset($res['endpoints']['sharedInbox']) ? $res['endpoints']['sharedInbox'] : null;
|
||||
|
|
Loading…
Reference in a new issue