]> git.mxchange.org Git - friendica.git/commitdiff
Fix notice in Model\Profile
authorMichael <heluecht@pirati.ca>
Wed, 12 Jun 2019 19:41:15 +0000 (19:41 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 12 Jun 2019 19:41:15 +0000 (19:41 +0000)
src/Model/Profile.php

index f78edb5bd071408b9836e9b45d1eeac422c7d65f..868cc6b70a7f12e9e4a46c6b2a258d431a53b8ed 100644 (file)
@@ -117,6 +117,11 @@ class Profile
                }
 
                if (count($profiledata) > 0) {
+                       // Ensure to have a "nickname" field
+                       if (empty($profiledata['nickname']) && !empty($profiledata['nick'])) {
+                               $profiledata['nickname'] = $profiledata['nick'];
+                       }
+
                        // Add profile data to sidebar
                        $a->page['aside'] .= self::sidebar($a, $profiledata, true, $show_connect);
 
@@ -317,12 +322,12 @@ class Profile
 
 
                $visitor_contact = [];
-               if ($profile['uid'] && self::getMyURL()) {
+               if (!empty($profile['uid']) && self::getMyURL()) {
                        $visitor_contact = Contact::selectFirst(['rel'], ['uid' => $profile['uid'], 'nurl' => Strings::normaliseLink(self::getMyURL())]);
                }
 
                $profile_contact = [];
-               if ($profile['cid'] && self::getMyURL()) {
+               if (!empty($profile['cid']) && self::getMyURL()) {
                        $profile_contact = Contact::selectFirst(['rel'], ['id' => $profile['cid']]);
                }