]> git.mxchange.org Git - friendica.git/commitdiff
Fix for empty profile pages
authorMichael <heluecht@pirati.ca>
Sat, 22 May 2021 05:34:10 +0000 (05:34 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 22 May 2021 05:34:10 +0000 (05:34 +0000)
src/Model/Profile.php

index 1476d67a51c6d152dfd42975761fc69683b33049..c1d85bfe00354cc77fd5d5d20aeff2b246b0dadb 100644 (file)
@@ -166,17 +166,7 @@ class Profile
                        }
                }
 
-               if (empty($user['uid'])) {
-                       $profile = [];
-               } else {
-                       $contact_id = Contact::getIdForURL(Strings::normaliseLink(DI::baseurl() . '/profile/' . $nickname), local_user());
-                       $profile = array_merge(
-                               $user,
-                               Contact::getById($contact_id),
-                               Profile::getByUID($user['uid']),
-                       );
-                       $profile['cid'] = $contact_id;
-               }
+               $profile = !empty($user['uid']) ? User::getOwnerDataById($user['uid'], false) : [];
 
                if (empty($profile) && empty($profiledata)) {
                        Logger::log('profile error: ' . DI::args()->getQueryString(), Logger::DEBUG);
@@ -344,7 +334,7 @@ class Profile
 
                        if (Contact::canReceivePrivateMessages($profile)) {
                                if ($visitor_is_followed || $visitor_is_following) {
-                                       $wallmessage_link = $visitor_base_path . '/message/new/' . $profile['cid'];
+                                       $wallmessage_link = $visitor_base_path . '/message/new/' . base64_encode($profile['addr'] ?? '');
                                } elseif ($visitor_is_authenticated && !empty($profile['unkmail'])) {
                                        $wallmessage_link = 'wallmessage/' . $profile['nickname'];
                                }