From f1e577fd01b8073a46f9d0e9df4f18c6f1fd830e Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Thu, 1 Nov 2018 07:09:17 -0400 Subject: [PATCH] Don't attempt to dereference in the outbox --- includes/server/activities/accept.php | 2 +- includes/server/activities/block.php | 2 +- includes/server/activities/create.php | 2 +- includes/server/activities/delete.php | 2 +- includes/server/activities/follow.php | 2 +- includes/server/activities/like.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/server/activities/accept.php b/includes/server/activities/accept.php index 7e5f25f..55557e2 100644 --- a/includes/server/activities/accept.php +++ b/includes/server/activities/accept.php @@ -48,7 +48,7 @@ function handle_outbox( $actor_slug, $activity ) { array( 'status' => 400 ) ); } - $object = \pterotype\util\dereference_object( $activity['object'] ); + $object = $activity['object']; if ( array_key_exists( 'type', $object ) ) { switch ( $object['type'] ) { case 'Follow': diff --git a/includes/server/activities/block.php b/includes/server/activities/block.php index 18affe1..68a8908 100644 --- a/includes/server/activities/block.php +++ b/includes/server/activities/block.php @@ -14,7 +14,7 @@ function handle_outbox( $actor, $activity ) { ); } $actor_id = \pterotype\actors\get_actor_id( $actor ); - $object = \pterotype\util\dereference_object( $activity['object'] ); + $object = $activity['object']; $res = \pterotype\blocks\create_block( $actor_id, $object ); if ( is_wp_error( $res ) ) { return $res; diff --git a/includes/server/activities/create.php b/includes/server/activities/create.php index 4b56314..429808f 100644 --- a/includes/server/activities/create.php +++ b/includes/server/activities/create.php @@ -30,7 +30,7 @@ function handle_outbox( $actor_slug, $activity ) { 'invalid_actor', __( 'Expecting a valid actor', 'pterotype' ) ); } - $object = \pterotype\util\dereference_object( $activity['object'] ); + $object = $activity['object']; $attributed_actor = $activity['actor']; $object['attributedTo'] = $attributed_actor; reconcile_receivers( $object, $activity ); diff --git a/includes/server/activities/delete.php b/includes/server/activities/delete.php index 7759938..1ef172f 100644 --- a/includes/server/activities/delete.php +++ b/includes/server/activities/delete.php @@ -14,7 +14,7 @@ function handle_outbox( $actor, $activity ) { array( 'status' => 400 ) ); } - $object = \pterotype\util\dereference_object( $activity['object'] ); + $object = $activity['object']; $tombstone = \pterotype\objects\delete_object( $object ); if ( is_wp_error( $tombstone ) ) { return $tombstone; diff --git a/includes/server/activities/follow.php b/includes/server/activities/follow.php index 2a4a887..0e9e32a 100644 --- a/includes/server/activities/follow.php +++ b/includes/server/activities/follow.php @@ -15,7 +15,7 @@ function handle_outbox( $actor_slug, $activity ) { array( 'status' => 400 ) ); } - $object = \pterotype\util\dereference_object( $activity['object'] ); + $object = $activity['object']; $object_row = \pterotype\objects\upsert_object( $object ); $actor_id = \pterotype\actors\get_actor_id( $actor_slug ); $res = \pterotype\following\request_follow( $actor_id, $object_row->id ); diff --git a/includes/server/activities/like.php b/includes/server/activities/like.php index f6f90b7..12265d3 100644 --- a/includes/server/activities/like.php +++ b/includes/server/activities/like.php @@ -14,7 +14,7 @@ function handle_outbox( $actor, $activity ) { array( 'status' => 400 ) ); } - $object = \pterotype\util\dereference_object( $activity['object'] ); + $object = $activity['object']; if ( !array_key_exists( 'id', $object ) ) { return new \WP_Error( 'invalid_object',