From 9af54707b992205f329cf24c2c429c7361c6d2aa Mon Sep 17 00:00:00 2001 From: Django Doucet Date: Fri, 27 Oct 2023 08:27:12 -0600 Subject: [PATCH] fix warnings --- includes/functions.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index 2e87a98..c06761f 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -342,13 +342,15 @@ function reply_recipients( $object_id, $post = null ) { $recipients[] = \ActivityPub\url_to_webfinger( $ap_object['actor'] ); // Reply to Object actor! if ( ! empty( $ap_object['object']['tag'] ) ) { // Reply to other tagged users. - $author_post_url = \get_author_posts_url( $ap_object['user_id'] );// ignore self tag. - foreach ( $ap_object['object']['tag'] as $tag ) { // Other tagged users - if ( $author_post_url === $tag['href'] ) { - continue; - } - if ( in_array( 'Mention', $tag ) ) { - $recipients[] = $tag['name']; + if ( isset( $ap_object['user_id'] ) ) { + $author_post_url = \get_author_posts_url( $ap_object['user_id'] );// ignore self tag. + foreach ( $ap_object['object']['tag'] as $tag ) { // Other tagged users + if ( $author_post_url === $tag['href'] ) { + continue; + } + if ( in_array( 'Mention', $tag ) ) { + $recipients[] = $tag['name']; + } } } }