From 23cd89da4cb72cd94959fc8b16c50843683e2812 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 23 Aug 2019 20:18:58 -0600 Subject: [PATCH 1/2] Update AP Helpers --- app/Util/ActivityPub/Helpers.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Util/ActivityPub/Helpers.php b/app/Util/ActivityPub/Helpers.php index 7bba5d5ba..048b35dc5 100644 --- a/app/Util/ActivityPub/Helpers.php +++ b/app/Util/ActivityPub/Helpers.php @@ -413,8 +413,8 @@ class Helpers { $profile = new Profile(); $profile->domain = $domain; $profile->username = (string) Purify::clean($remoteUsername); - $profile->name = Purify::clean($res['name']) ?? 'user'; - $profile->bio = Purify::clean($res['summary']); + $profile->name = isset($res['name']) ? Purify::clean($res['name']) : 'user'; + $profile->bio = isset($res['summary']) ? Purify::clean($res['summary']) : null; $profile->sharedInbox = isset($res['endpoints']) && isset($res['endpoints']['sharedInbox']) ? $res['endpoints']['sharedInbox'] : null; $profile->inbox_url = $res['inbox']; $profile->outbox_url = $res['outbox']; From f54409fdf35af861afe67ea3dcee7c0546bcb6b7 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Fri, 23 Aug 2019 21:28:37 -0600 Subject: [PATCH 2/2] Update AP Helpers --- app/Util/ActivityPub/Helpers.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Util/ActivityPub/Helpers.php b/app/Util/ActivityPub/Helpers.php index 048b35dc5..467298911 100644 --- a/app/Util/ActivityPub/Helpers.php +++ b/app/Util/ActivityPub/Helpers.php @@ -181,7 +181,7 @@ class Helpers { public static function zttpUserAgent() { return [ - 'Accept' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', + 'Accept' => 'application/activity+json', 'User-Agent' => 'PixelfedBot - https://pixelfed.org', ]; } @@ -280,8 +280,8 @@ class Helpers { $unlisted = false; } - $cw = config('costar.domain.cw'); - if(in_array(parse_url($url, PHP_URL_HOST), $cw) == true) { + $cwDomains = config('costar.domain.cw'); + if(in_array(parse_url($url, PHP_URL_HOST), $cwDomains) == true) { $cw = true; } }