Ward against invalid name from receiver in ActivityPub::storeReceivers
- Address part of https://github.com/friendica/friendica/issues/12011#issuecomment-1338133783
This commit is contained in:
parent
f3dc69c226
commit
c70d657885
1 changed files with 4 additions and 1 deletions
|
@ -1273,8 +1273,11 @@ class Processor
|
||||||
foreach ($receivers[$element] as $receiver) {
|
foreach ($receivers[$element] as $receiver) {
|
||||||
if ($receiver == ActivityPub::PUBLIC_COLLECTION) {
|
if ($receiver == ActivityPub::PUBLIC_COLLECTION) {
|
||||||
$name = Receiver::PUBLIC_COLLECTION;
|
$name = Receiver::PUBLIC_COLLECTION;
|
||||||
|
} elseif ($path = parse_url($receiver, PHP_URL_PATH)) {
|
||||||
|
$name = trim($path, '/');
|
||||||
} else {
|
} else {
|
||||||
$name = trim(parse_url($receiver, PHP_URL_PATH), '/');
|
Logger::warning('Unable to coerce name from receiver', ['receiver' => $receiver]);
|
||||||
|
$name = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$target = Tag::getTargetType($receiver);
|
$target = Tag::getTargetType($receiver);
|
||||||
|
|
Loading…
Reference in a new issue