Fix processing of profile image for bridgy webmentions

This commit is contained in:
Jonny Barnes 2024-03-22 18:50:25 +00:00
parent 21e2b5217e
commit 47b39edaeb
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8

View file

@ -109,8 +109,16 @@ class WebMention extends Model
/**
* Create the photo link.
*/
public function createPhotoLink(string $url): string
public function createPhotoLink(string|array $url): string
{
if (is_array($url)) {
if (! array_key_exists('value', $url)) {
return '';
}
$url = $url['value'];
}
$url = normalize_url($url);
$host = parse_url($url, PHP_URL_HOST);