Check for user array key before using it in include/conversation
- Address https://github.com/friendica/friendica/issues/10473#issuecomment-905752992
This commit is contained in:
parent
dc78686281
commit
3e677414d5
|
@ -1068,11 +1068,14 @@ function format_activity(array $links, $verb, $id) {
|
||||||
|
|
||||||
function status_editor(App $a, array $x = [], $notes_cid = 0, $popup = false)
|
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');
|
DI::profiler()->startRecording('rendering');
|
||||||
$o = '';
|
$o = '';
|
||||||
|
|
||||||
$user = User::getById($a->getLoggedInUserId(), ['uid', 'nickname', 'allow_location', 'default-location']);
|
|
||||||
|
|
||||||
$x['allow_location'] = $x['allow_location'] ?? $user['allow_location'];
|
$x['allow_location'] = $x['allow_location'] ?? $user['allow_location'];
|
||||||
$x['default_location'] = $x['default_location'] ?? $user['default-location'];
|
$x['default_location'] = $x['default_location'] ?? $user['default-location'];
|
||||||
$x['nickname'] = $x['nickname'] ?? $user['nickname'];
|
$x['nickname'] = $x['nickname'] ?? $user['nickname'];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user