Skip to content

Commit ad81953

Browse files
committed
Only assume a DM when the user is in the to
1 parent 1de553e commit ad81953

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

includes/class-mailer.php

+5
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ public static function direct_message( $activity, $user_id ) {
157157
return;
158158
}
159159

160+
// Only accept messages that have the user in the "to" field.
161+
if ( ! in_array( \get_author_posts_url( $user_id ), $activity['to'] ) ) {
162+
return;
163+
}
164+
160165
$actor = get_remote_metadata_by_actor( $activity['actor'] );
161166

162167
if ( ! $actor || \is_wp_error( $actor ) || empty( $activity['object']['content'] ) ) {

0 commit comments

Comments
 (0)