forked from GNUsocial/gnu-social
[ActivityPub] Ensuring federation with other software
ActivityPubPlugin: - Prevent sending a Delete for an Announce Activitypub_announce: - Update announce_to_array to add id, to and cc information to the retrieved object Activitypub_follow: - Add id to the arguments of follow_to_array, useful for Accept-Follow activities Activitypub_notice: - Fix notice validation, url isn't a MUST Activitypub_inbox_handler: - Make handle_follow use the received activity id for the later Accept-Follow Activitypub_postman: - Fix call to the updated announce_to_array - Fix successive unnecessary calls to ActivityPubPlugin::actor_uri()
This commit is contained in:
@@ -77,7 +77,7 @@ class Activitypub_notice extends Managed_DataObject
|
||||
'published' => str_replace(' ', 'T', $notice->getCreated()).'Z',
|
||||
'url' => self::getUrl($notice),
|
||||
'attributedTo' => ActivityPubPlugin::actor_uri($profile),
|
||||
'to' => ['https://www.w3.org/ns/activitystreams#Public'],
|
||||
'to' => $to,
|
||||
'cc' => $cc,
|
||||
'conversation' => $notice->getConversationUrl(),
|
||||
'content' => $notice->getRendered(),
|
||||
@@ -235,9 +235,7 @@ class Activitypub_notice extends Managed_DataObject
|
||||
common_debug('ActivityPub Notice Validator: Rejected because Content was not specified.');
|
||||
throw new Exception('Object content was not specified.');
|
||||
}
|
||||
if (!isset($object['url'])) {
|
||||
throw new Exception('Object URL was not specified.');
|
||||
} elseif (!filter_var($object['url'], FILTER_VALIDATE_URL)) {
|
||||
if (isset($object['url']) && !filter_var($object['url'], FILTER_VALIDATE_URL)) {
|
||||
common_debug('ActivityPub Notice Validator: Rejected because Object URL is invalid.');
|
||||
throw new Exception('Invalid Object URL.');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user