mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-24 14:03:16 +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'])
|
!self::validateUrl($activity['object']['attributedTo'])
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
|
@ -400,7 +400,10 @@ class Helpers {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$domain = parse_url($res['id'], PHP_URL_HOST);
|
$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)) {
|
if(empty($username)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue