From 8e74fb1754c592e66616e165888cdcb97cf3a627 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 26 Mar 2023 20:44:25 -0400 Subject: [PATCH] Add receiver name extraction case - Address https://github.com/friendica/friendica/issues/12488#issuecomment-1445359764 --- src/Protocol/ActivityPub/Processor.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index d6dc834fc0..1963d7e057 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -1278,8 +1278,10 @@ class Processor $name = Receiver::PUBLIC_COLLECTION; } elseif ($path = parse_url($receiver, PHP_URL_PATH)) { $name = trim($path, '/'); + } elseif ($host = parse_url($receiver, PHP_URL_HOST)) { + $name = $host; } else { - Logger::warning('Unable to coerce name from receiver', ['receiver' => $receiver]); + Logger::warning('Unable to coerce name from receiver', ['element' => $element, 'type' => $type, 'receiver' => $receiver]); $name = ''; }