updated plugin ActivityPub
version 2.2.0
This commit is contained in:
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user