forked from mirror/pixelfed
Merge pull request #682 from pixelfed/frontend-ui-refactor
Update FederationController
This commit is contained in:
commit
a88b6e6b68
|
@ -191,6 +191,14 @@ XML;
|
||||||
$id = Helpers::validateUrl($bodyDecoded['id']);
|
$id = Helpers::validateUrl($bodyDecoded['id']);
|
||||||
$keyDomain = parse_url($keyId, PHP_URL_HOST);
|
$keyDomain = parse_url($keyId, PHP_URL_HOST);
|
||||||
$idDomain = parse_url($id, PHP_URL_HOST);
|
$idDomain = parse_url($id, PHP_URL_HOST);
|
||||||
|
if(isset($bodyDecoded['object'])
|
||||||
|
&& is_array($bodyDecoded['object'])
|
||||||
|
&& isset($bodyDecoded['object']['attributedTo'])
|
||||||
|
) {
|
||||||
|
if(parse_url($bodyDecoded['object']['attributedTo'], PHP_URL_HOST) !== $keyDomain) {
|
||||||
|
abort(400, 'Invalid request');
|
||||||
|
}
|
||||||
|
}
|
||||||
if(!$keyDomain || !$idDomain || $keyDomain !== $idDomain) {
|
if(!$keyDomain || !$idDomain || $keyDomain !== $idDomain) {
|
||||||
abort(400, 'Invalid request');
|
abort(400, 'Invalid request');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue