mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Update InboxPipeline, fix peertube attributedTo parsing
This commit is contained in:
parent
50b3369a09
commit
99fb80bf5d
3 changed files with 29 additions and 5 deletions
|
@ -140,9 +140,17 @@ class DeleteWorker implements ShouldQueue
|
|||
&& is_array($bodyDecoded['object'])
|
||||
&& isset($bodyDecoded['object']['attributedTo'])
|
||||
) {
|
||||
if(parse_url($bodyDecoded['object']['attributedTo'], PHP_URL_HOST) !== $keyDomain) {
|
||||
return;
|
||||
}
|
||||
$attr = Helpers::pluckval($bodyDecoded['object']['attributedTo']);
|
||||
if(is_array($attr)) {
|
||||
if(isset($attr['id'])) {
|
||||
$attr = $attr['id'];
|
||||
} else {
|
||||
$attr = "";
|
||||
}
|
||||
}
|
||||
if(parse_url($attr, PHP_URL_HOST) !== $keyDomain) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if(!$keyDomain || !$idDomain || $keyDomain !== $idDomain) {
|
||||
return;
|
||||
|
|
|
@ -167,7 +167,15 @@ class InboxValidator implements ShouldQueue
|
|||
&& is_array($bodyDecoded['object'])
|
||||
&& isset($bodyDecoded['object']['attributedTo'])
|
||||
) {
|
||||
if(parse_url(Helpers::pluckval($bodyDecoded['object']['attributedTo']), PHP_URL_HOST) !== $keyDomain) {
|
||||
$attr = Helpers::pluckval($bodyDecoded['object']['attributedTo']);
|
||||
if(is_array($attr)) {
|
||||
if(isset($attr['id'])) {
|
||||
$attr = $attr['id'];
|
||||
} else {
|
||||
$attr = "";
|
||||
}
|
||||
}
|
||||
if(parse_url($attr, PHP_URL_HOST) !== $keyDomain) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -157,7 +157,15 @@ class InboxWorker implements ShouldQueue
|
|||
&& is_array($bodyDecoded['object'])
|
||||
&& isset($bodyDecoded['object']['attributedTo'])
|
||||
) {
|
||||
if(parse_url(Helpers::pluckval($bodyDecoded['object']['attributedTo']), PHP_URL_HOST) !== $keyDomain) {
|
||||
$attr = Helpers::pluckval($bodyDecoded['object']['attributedTo']);
|
||||
if(is_array($attr)) {
|
||||
if(isset($attr['id'])) {
|
||||
$attr = $attr['id'];
|
||||
} else {
|
||||
$attr = "";
|
||||
}
|
||||
}
|
||||
if(parse_url($attr, PHP_URL_HOST) !== $keyDomain) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue