From 7fbfee1a74ffda4158caee099b390eeaf1bdad09 Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Thu, 18 Jul 2024 08:23:34 +0200 Subject: [PATCH] fix extra fields (#814) --- includes/class-activitypub.php | 2 +- includes/model/class-user.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-activitypub.php b/includes/class-activitypub.php index 7e31f344a..9e5796e90 100644 --- a/includes/class-activitypub.php +++ b/includes/class-activitypub.php @@ -515,7 +515,7 @@ public static function user_register( $user_id ) { * @return array The extra fields. */ public static function default_actor_extra_fields( $extra_fields, $user_id ) { - if ( $extra_fields ) { + if ( $extra_fields || ! $user_id ) { return $extra_fields; } diff --git a/includes/model/class-user.php b/includes/model/class-user.php index 64233eee8..dc6cb6c04 100644 --- a/includes/model/class-user.php +++ b/includes/model/class-user.php @@ -235,7 +235,7 @@ public function get_endpoints() { * @return array The extended User-Output. */ public function get_attachment() { - $extra_fields = get_actor_extra_fields( \get_current_user_id() ); + $extra_fields = get_actor_extra_fields( $this->_id ); $attachments = array();