updated plugin ActivityPub version 9.1.0

This commit is contained in:
2026-07-28 15:03:10 +00:00
committed by Gitium
parent bf428f0e45
commit ff806e1811
217 changed files with 6098 additions and 3025 deletions

View File

@ -94,7 +94,7 @@ function is_self_ping( $id ) {
if (
is_same_domain( $id ) &&
in_array( 'c', array_keys( $query ), true )
\in_array( 'c', \array_keys( $query ), true )
) {
return true;
}
@ -122,9 +122,26 @@ function add_to_outbox( $data, $activity_type = null, $user_id = 0, $content_vis
}
}
/*
* Refuse to Update an object that is already deleted from the Fediverse. An
* explicit Update (e.g. `wp activitypub post update` or a third-party caller)
* on a soft-deleted post would only federate a Tombstone, and — worse — would
* reset the object's state to "federated" below, so a later re-publish would
* skip the Create that cancels the still-pending Delete and the post could be
* torn down after it is public again. Re-publishing is the supported way to
* bring a deleted object back, and that emits a Create, not an Update.
*/
if ( 'Update' === $activity_type && ACTIVITYPUB_OBJECT_STATE_DELETED === get_wp_object_state( $data ) ) {
return new \WP_Error(
'activitypub_object_deleted',
\__( 'Cannot send an Update for an object that has been deleted from the Fediverse. Re-publish it instead.', 'activitypub' ),
array( 'status' => 409 )
);
}
$transformer = Transformer_Factory::get_transformer( $data );
if ( ! $transformer || is_wp_error( $transformer ) ) {
if ( ! $transformer || \is_wp_error( $transformer ) ) {
return false;
}