]> git.mxchange.org Git - friendica.git/commitdiff
Add receiver name extraction case
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 27 Mar 2023 00:44:25 +0000 (20:44 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Fri, 31 Mar 2023 18:18:55 +0000 (14:18 -0400)
- Address https://github.com/friendica/friendica/issues/12488#issuecomment-1445359764

src/Protocol/ActivityPub/Processor.php

index d6dc834fc01393851cd43bdd571110f9c35b2e5d..1963d7e057495d60c169bd82ffa424a14f184767 100644 (file)
@@ -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 = '';
                                        }