From: Hypolite Petovan Date: Fri, 3 Sep 2021 17:09:06 +0000 (-0400) Subject: Check for user array key before using it in include/conversation X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3e677414d5b37b7e46b459650808973ed6d3f802;p=friendica.git Check for user array key before using it in include/conversation - Address https://github.com/friendica/friendica/issues/10473#issuecomment-905752992 --- diff --git a/include/conversation.php b/include/conversation.php index 1f337859b5..352060d7f2 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'];