Merge pull request #10285 from annando/revert-10280

Fix for empty profile pages
This commit is contained in:
Tobias Diekershoff 2021-05-22 07:47:06 +02:00 committed by GitHub
commit aa32abbdb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -166,17 +166,7 @@ class Profile
} }
} }
if (empty($user['uid'])) { $profile = !empty($user['uid']) ? User::getOwnerDataById($user['uid'], false) : [];
$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;
}
if (empty($profile) && empty($profiledata)) { if (empty($profile) && empty($profiledata)) {
Logger::log('profile error: ' . DI::args()->getQueryString(), Logger::DEBUG); Logger::log('profile error: ' . DI::args()->getQueryString(), Logger::DEBUG);
@ -344,7 +334,7 @@ class Profile
if (Contact::canReceivePrivateMessages($profile)) { if (Contact::canReceivePrivateMessages($profile)) {
if ($visitor_is_followed || $visitor_is_following) { 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'])) { } elseif ($visitor_is_authenticated && !empty($profile['unkmail'])) {
$wallmessage_link = 'wallmessage/' . $profile['nickname']; $wallmessage_link = 'wallmessage/' . $profile['nickname'];
} }