updated plugin ActivityPub version 2.2.0

This commit is contained in:
2024-03-28 09:39:50 +00:00
committed by Gitium
parent fd53533f59
commit 00c5db12cc
50 changed files with 1726 additions and 374 deletions

@ -42,16 +42,31 @@ class Webfinger {
return $data;
}
if ( ! is_array( $data ) || empty( $data['links'] ) ) {
return new WP_Error(
'webfinger_missing_links',
__( 'No valid Link elements found.', 'activitypub' ),
$data
);
}
foreach ( $data['links'] as $link ) {
if (
'self' === $link['rel'] &&
'application/activity+json' === $link['type']
(
'application/activity+json' === $link['type'] ||
'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' === $link['type']
)
) {
return $link['href'];
}
}
return new WP_Error( 'webfinger_url_no_activitypub', null, $data );
return new WP_Error(
'webfinger_url_no_activitypub',
__( 'The Site supports WebFinger but not ActivityPub', 'activitypub' ),
$data
);
}
/**