]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Profile.php
Several more warnings ... (#5340)
[friendica.git] / src / Model / Profile.php
index c006f184001e803c921a3a44108183e5acb78a68..866065ec72612125f5c0db8362af82c392df48e0 100644 (file)
@@ -40,11 +40,11 @@ class Profile
        {
                $location = '';
 
-               if ($profile['locality']) {
+               if (!empty($profile['locality'])) {
                        $location .= $profile['locality'];
                }
 
-               if ($profile['region'] && ($profile['locality'] != $profile['region'])) {
+               if (!empty($profile['region']) && (defaults($profile, 'locality', '') != $profile['region'])) {
                        if ($location) {
                                $location .= ', ';
                        }
@@ -52,7 +52,7 @@ class Profile
                        $location .= $profile['region'];
                }
 
-               if ($profile['country-name']) {
+               if (!empty($profile['country-name'])) {
                        if ($location) {
                                $location .= ', ';
                        }
@@ -307,6 +307,8 @@ class Profile
                        $connect = false;
                }
 
+               $profile_url = '';
+
                // Is the local user already connected to that user?
                if ($connect && local_user()) {
                        if (isset($profile['url'])) {
@@ -437,9 +439,9 @@ class Profile
                                'fullname' => $profile['name'],
                                'firstname' => $firstname,
                                'lastname' => $lastname,
-                               'photo300' => $profile['contact_photo'],
-                               'photo100' => $profile['contact_thumb'],
-                               'photo50' => $profile['contact_micro'],
+                               'photo300' => defaults($profile, 'contact_photo', ''),
+                               'photo100' => defaults($profile, 'contact_thumb', ''),
+                               'photo50' => defaults($profile, 'contact_micro', ''),
                        ];
                } else {
                        $diaspora = false;
@@ -497,7 +499,7 @@ class Profile
                        $p['photo'] = proxy_url($p['photo'], false, PROXY_SIZE_SMALL);
                }
 
-               $p['url'] = Contact::magicLink($p['url']);
+               $p['url'] = Contact::magicLink(defaults($p, 'url', $profile_url));
 
                $tpl = get_markup_template('profile_vcard.tpl');
                $o .= replace_macros($tpl, [