From 3e677414d5b37b7e46b459650808973ed6d3f802 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 3 Sep 2021 13:09:06 -0400 Subject: [PATCH] Check for user array key before using it in include/conversation - Address https://github.com/friendica/friendica/issues/10473#issuecomment-905752992 --- include/conversation.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 1f337859b..352060d7f 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -1068,11 +1068,14 @@ function format_activity(array $links, $verb, $id) { function status_editor(App $a, array $x = [], $notes_cid = 0, $popup = false) { + $user = User::getById($a->getLoggedInUserId(), ['uid', 'nickname', 'allow_location', 'default-location']); + if (empty($user['uid'])) { + return ''; + } + DI::profiler()->startRecording('rendering'); $o = ''; - $user = User::getById($a->getLoggedInUserId(), ['uid', 'nickname', 'allow_location', 'default-location']); - $x['allow_location'] = $x['allow_location'] ?? $user['allow_location']; $x['default_location'] = $x['default_location'] ?? $user['default-location']; $x['nickname'] = $x['nickname'] ?? $user['nickname'];