mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +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;
|
return;
|
||||||
}
|
}
|
||||||
$domain = parse_url($res['id'], PHP_URL_HOST);
|
$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}";
|
$remoteUsername = "@{$username}@{$domain}";
|
||||||
|
|
||||||
abort_if(!self::validateUrl($res['inbox']), 400);
|
abort_if(!self::validateUrl($res['inbox']), 400);
|
||||||
|
@ -414,7 +417,7 @@ class Helpers {
|
||||||
if(!$profile) {
|
if(!$profile) {
|
||||||
$profile = new Profile;
|
$profile = new Profile;
|
||||||
$profile->domain = $domain;
|
$profile->domain = $domain;
|
||||||
$profile->username = Purify::clean($remoteUsername);
|
$profile->username = (string) Purify::clean($remoteUsername);
|
||||||
$profile->name = Purify::clean($res['name']) ?? 'user';
|
$profile->name = Purify::clean($res['name']) ?? 'user';
|
||||||
$profile->bio = Purify::clean($res['summary']);
|
$profile->bio = Purify::clean($res['summary']);
|
||||||
$profile->sharedInbox = isset($res['endpoints']) && isset($res['endpoints']['sharedInbox']) ? $res['endpoints']['sharedInbox'] : null;
|
$profile->sharedInbox = isset($res['endpoints']) && isset($res['endpoints']['sharedInbox']) ? $res['endpoints']['sharedInbox'] : null;
|
||||||
|
|
Loading…
Reference in a new issue