From 0736e4e42c42e39d82dee183cedfe9dc2fb88496 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 26 Jan 2020 16:44:02 -0500 Subject: [PATCH] Check for $a->user["nickname"] existence before retrieving its value in mod/display - Addresses part of https://github.com/friendica/friendica/issues/8000#issuecomment-573883153 --- mod/display.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/display.php b/mod/display.php index b5edafc5f9..f9c7f9dcf7 100644 --- a/mod/display.php +++ b/mod/display.php @@ -97,9 +97,9 @@ function display_init(App $a) $profiledata = display_fetchauthor($a, $item); if (strstr(Strings::normaliseLink($profiledata["url"]), Strings::normaliseLink(DI::baseUrl()))) { - $nickname = str_replace(Strings::normaliseLink(DI::baseUrl())."/profile/", "", Strings::normaliseLink($profiledata["url"])); + $nickname = str_replace(Strings::normaliseLink(DI::baseUrl()) . "/profile/", "", Strings::normaliseLink($profiledata["url"])); - if ($nickname != $a->user["nickname"]) { + if (!empty($a->user["nickname"]) && $nickname != $a->user["nickname"]) { $profile = DBA::fetchFirst("SELECT `profile`.* , `contact`.`avatar-date` AS picdate, `user`.* FROM `profile` INNER JOIN `contact` on `contact`.`uid` = `profile`.`uid` INNER JOIN `user` ON `profile`.`uid` = `user`.`uid` WHERE `user`.`nickname` = ? AND `profile`.`is-default` AND `contact`.`self` LIMIT 1", -- 2.39.5