mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 21:43:17 +00:00
Update AP helpers
This commit is contained in:
parent
1cbf8dcb38
commit
18f32e7bcf
1 changed files with 5 additions and 2 deletions
|
@ -285,7 +285,7 @@ class Helpers {
|
|||
}
|
||||
}
|
||||
|
||||
if(!self::validateUrl($activity['object']['id']) ||
|
||||
if(!self::validateUrl($res['id']) ||
|
||||
!self::validateUrl($activity['object']['attributedTo'])
|
||||
) {
|
||||
return;
|
||||
|
@ -400,7 +400,10 @@ class Helpers {
|
|||
return;
|
||||
}
|
||||
$domain = parse_url($res['id'], PHP_URL_HOST);
|
||||
$username = (string) Purify::clean($res['preferredUsername']);
|
||||
if(!isset($res['preferredUsername']) && !isset($res['nickname'])) {
|
||||
return;
|
||||
}
|
||||
$username = (string) Purify::clean($res['preferredUsername'] ?? $res['nickname']);
|
||||
if(empty($username)) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue