From 30129adac564f6c1b140fb41a53b3b9f076ec461 Mon Sep 17 00:00:00 2001 From: Django Doucet Date: Mon, 6 Feb 2023 22:43:39 -0700 Subject: [PATCH] Remove remote comments from preprocessing --- includes/class-comments.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/class-comments.php b/includes/class-comments.php index 6cf3d8c..03d8740 100644 --- a/includes/class-comments.php +++ b/includes/class-comments.php @@ -27,6 +27,9 @@ class Comments { */ public static function preprocess_comment( $commentdata ) { // only process replies from authorized local actors, for ap enabled post types + if ( ! isset( $commentdata['user_id'] ) ) { + return $commentdata; + } $user = \get_userdata( $commentdata['user_id'] ); $comment_post_type = \get_post_type( $commentdata['comment_post_ID'] ); $post_types = \get_option( 'activitypub_support_post_types', array( 'post', 'page' ) );