mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-10 00:34:50 +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'])
|
&& is_array($bodyDecoded['object'])
|
||||||
&& isset($bodyDecoded['object']['attributedTo'])
|
&& isset($bodyDecoded['object']['attributedTo'])
|
||||||
) {
|
) {
|
||||||
if(parse_url($bodyDecoded['object']['attributedTo'], PHP_URL_HOST) !== $keyDomain) {
|
$attr = Helpers::pluckval($bodyDecoded['object']['attributedTo']);
|
||||||
return;
|
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) {
|
if(!$keyDomain || !$idDomain || $keyDomain !== $idDomain) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -167,7 +167,15 @@ class InboxValidator implements ShouldQueue
|
||||||
&& is_array($bodyDecoded['object'])
|
&& is_array($bodyDecoded['object'])
|
||||||
&& isset($bodyDecoded['object']['attributedTo'])
|
&& 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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,7 +157,15 @@ class InboxWorker implements ShouldQueue
|
||||||
&& is_array($bodyDecoded['object'])
|
&& is_array($bodyDecoded['object'])
|
||||||
&& isset($bodyDecoded['object']['attributedTo'])
|
&& 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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue