From 47b39edaeb048e0b74ce52837ed2603fa029c665 Mon Sep 17 00:00:00 2001 From: Jonny Barnes Date: Fri, 22 Mar 2024 18:50:25 +0000 Subject: [PATCH] Fix processing of profile image for bridgy webmentions --- app/Models/WebMention.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/Models/WebMention.php b/app/Models/WebMention.php index a1514517..cf418b90 100644 --- a/app/Models/WebMention.php +++ b/app/Models/WebMention.php @@ -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);