mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-23 16:24:29 +00:00
Update InboxPipeline, fixes #3332
This commit is contained in:
parent
f8931dc7cd
commit
4287f14bc5
2 changed files with 4 additions and 5 deletions
|
@ -167,9 +167,8 @@ class InboxValidator implements ShouldQueue
|
||||||
&& is_array($bodyDecoded['object'])
|
&& is_array($bodyDecoded['object'])
|
||||||
&& isset($bodyDecoded['object']['attributedTo'])
|
&& isset($bodyDecoded['object']['attributedTo'])
|
||||||
) {
|
) {
|
||||||
if(parse_url($bodyDecoded['object']['attributedTo'], PHP_URL_HOST) !== $keyDomain) {
|
if(parse_url(Helpers::pluckval($bodyDecoded['object']['attributedTo']), PHP_URL_HOST) !== $keyDomain) {
|
||||||
return;
|
return;
|
||||||
abort(400, 'Invalid request');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!$keyDomain || !$idDomain || $keyDomain !== $idDomain) {
|
if(!$keyDomain || !$idDomain || $keyDomain !== $idDomain) {
|
||||||
|
@ -178,7 +177,7 @@ class InboxValidator implements ShouldQueue
|
||||||
}
|
}
|
||||||
$actor = Profile::whereKeyId($keyId)->first();
|
$actor = Profile::whereKeyId($keyId)->first();
|
||||||
if(!$actor) {
|
if(!$actor) {
|
||||||
$actorUrl = is_array($bodyDecoded['actor']) ? $bodyDecoded['actor'][0] : $bodyDecoded['actor'];
|
$actorUrl = Helpers::pluckval($bodyDecoded['actor']);
|
||||||
$actor = Helpers::profileFirstOrNew($actorUrl);
|
$actor = Helpers::profileFirstOrNew($actorUrl);
|
||||||
}
|
}
|
||||||
if(!$actor) {
|
if(!$actor) {
|
||||||
|
|
|
@ -157,7 +157,7 @@ class InboxWorker implements ShouldQueue
|
||||||
&& is_array($bodyDecoded['object'])
|
&& is_array($bodyDecoded['object'])
|
||||||
&& isset($bodyDecoded['object']['attributedTo'])
|
&& isset($bodyDecoded['object']['attributedTo'])
|
||||||
) {
|
) {
|
||||||
if(parse_url($bodyDecoded['object']['attributedTo'], PHP_URL_HOST) !== $keyDomain) {
|
if(parse_url(Helpers::pluckval($bodyDecoded['object']['attributedTo']), PHP_URL_HOST) !== $keyDomain) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -166,7 +166,7 @@ class InboxWorker implements ShouldQueue
|
||||||
}
|
}
|
||||||
$actor = Profile::whereKeyId($keyId)->first();
|
$actor = Profile::whereKeyId($keyId)->first();
|
||||||
if(!$actor) {
|
if(!$actor) {
|
||||||
$actorUrl = is_array($bodyDecoded['actor']) ? $bodyDecoded['actor'][0] : $bodyDecoded['actor'];
|
$actorUrl = Helpers::pluckval($bodyDecoded['actor']);
|
||||||
$actor = Helpers::profileFirstOrNew($actorUrl);
|
$actor = Helpers::profileFirstOrNew($actorUrl);
|
||||||
}
|
}
|
||||||
if(!$actor) {
|
if(!$actor) {
|
||||||
|
|
Loading…
Reference in a new issue