Merge pull request #8805 from MrPetovan/bug/notices

Add logging to rare condition in Model\Profile::sidebar
pull/8813/head
Michael Vogel 2020-06-25 08:39:28 +02:00 zatwierdzone przez GitHub
commit 95ed81de5f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 3 dodań i 4 usunięć

Wyświetl plik

@ -258,7 +258,7 @@ class Profile
* @hooks 'profile_sidebar'
* array $arr
*/
private static function sidebar(App $a, $profile, $block = 0, $show_connect = true)
private static function sidebar(App $a, array $profile, $block = 0, $show_connect = true)
{
$o = '';
$location = false;
@ -266,7 +266,8 @@ class Profile
// This function can also use contact information in $profile
$is_contact = !empty($profile['cid']);
if (!is_array($profile) && !count($profile)) {
if (empty($profile['nickname'])) {
Logger::warning('Received profile with no nickname', ['profile' => $profile, 'callstack' => System::callstack(10)]);
return $o;
}
@ -291,8 +292,6 @@ class Profile
$subscribe_feed_link = null;
$wallmessage_link = null;
$visitor_contact = [];
if (!empty($profile['uid']) && self::getMyURL()) {
$visitor_contact = Contact::selectFirst(['rel'], ['uid' => $profile['uid'], 'nurl' => Strings::normaliseLink(self::getMyURL())]);