PluginProbe
ActivityPub / 2.6.0
ActivityPub v2.6.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-undo.php +7 -4 2.0.02.6.0 View file →
@@ -3,8 +3,10 @@
3 3
4 4 use Activitypub\Collection\Users;
5 5 use Activitypub\Collection\Followers;
6 6
7 +use function Activitypub\object_to_uri;
8 +
7 9 /**
8 10 * Handle Undo requests
9 11 */
10 12 class Undo {
@@ -27,12 +29,12 @@
27 29 public static function handle_undo( $activity ) {
28 30 if (
29 31 isset( $activity['object']['type'] ) &&
30 32 'Follow' === $activity['object']['type'] &&
31 - isset( $activity['object']['object'] ) &&
32 - filter_var( $activity['object']['object'], FILTER_VALIDATE_URL )
33 + isset( $activity['object']['object'] )
33 34 ) {
34 - $user = Users::get_by_resource( $activity['object']['object'] );
35 + $user_id = object_to_uri( $activity['object']['object'] );
36 + $user = Users::get_by_resource( $user_id );
35 37
36 38 if ( ! $user || is_wp_error( $user ) ) {
37 39 // If we can not find a user,
38 40 // we can not initiate a follow process
@@ -39,9 +41,10 @@
39 41 return;
40 42 }
41 43
42 44 $user_id = $user->get__id();
45 + $actor = object_to_uri( $activity['actor'] );
43 46
44 - Followers::remove_follower( $user_id, $activity['actor'] );
47 + Followers::remove_follower( $user_id, $actor );
45 48 }
46 49 }
47 50 }