updated plugin ActivityPub
version 2.2.0
This commit is contained in:
wp-content/plugins/activitypub
activitypub.php
build
follow-me
followers
remote-reply
includes
activity
class-activity-dispatcher.phpclass-activitypub.phpclass-admin.phpclass-blocks.phpclass-comment.phpclass-debug.phpclass-mention.phpclass-migration.phpclass-scheduler.phpclass-webfinger.phpfunctions.phphandler
model
rest
class-collection.phpclass-comment.phpclass-followers.phpclass-inbox.phpclass-nodeinfo.phpclass-outbox.phpclass-server.phpclass-users.php
transformer
integration
readme.txttemplates
@ -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