Add receiver name extraction case

- Address https://github.com/friendica/friendica/issues/12488#issuecomment-1445359764
This commit is contained in:
Hypolite Petovan 2023-03-26 20:44:25 -04:00
parent 5dd4bfb852
commit 8e74fb1754

View 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 = '';
}