PluginProbe
ActivityPub / 7.7.0
ActivityPub v7.7.0
9.3.1 9.3.0 9.2.2 9.2.1 9.2.0 9.1.0 9.0.2 9.0.1 9.0.0 8.3.0 8.2.1 8.2.0 8.1.1 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.2.0 1.3.0 2.0.0 2.0.1 2.1.0 2.1.1 All 160 releases
← All changes | includes/handler/class-accept.php +2 -12 9.2.07.7.0 View file →
@@ -10,9 +10,8 @@
10 10 use Activitypub\Collection\Following;
11 11 use Activitypub\Collection\Outbox;
12 12 use Activitypub\Collection\Remote_Actors;
13 13
14 -use function Activitypub\is_same_actor;
15 14 use function Activitypub\object_to_uri;
16 15
17 16 /**
18 17 * Handle Accept requests.
@@ -42,24 +41,15 @@
42 41 ) {
43 42 return;
44 43 }
45 44
46 - /*
47 - * For a Follow Accept, the sender must be the actor that was followed.
48 - * Without this, a signed Accept from one actor could confirm a Follow that
49 - * targeted another actor by referencing that pending Follow's outbox GUID.
50 - */
51 - if ( ! is_same_actor( $accept['actor'] ?? '', $accept['object']['object'] ?? '' ) ) {
52 - return;
53 - }
45 + $actor_post = Remote_Actors::get_by_uri( object_to_uri( $accept['object']['object'] ) );
54 46
55 - $actor_post = Remote_Actors::get_by_uri( object_to_uri( $accept['object']['object'] ?? '' ) );
56 -
57 47 if ( \is_wp_error( $actor_post ) ) {
58 48 return;
59 49 }
60 50
61 - $user_id = \is_array( $user_ids ) ? \reset( $user_ids ) : $user_ids;
51 + $user_id = is_array( $user_ids ) ? reset( $user_ids ) : $user_ids;
62 52 $result = Following::accept( $actor_post, $user_id );
63 53 $success = ! \is_wp_error( $result );
64 54
65 55 /**