mirror of
https://github.com/friendica/friendica
synced 2025-04-28 00:30:10 +00:00
Issue 14349: Fix profile page for unrelated contacts
This commit is contained in:
parent
66e9807876
commit
131e330e61
8 changed files with 440 additions and 476 deletions
|
@ -165,10 +165,12 @@ class Profile extends BaseModule
|
|||
}
|
||||
|
||||
// Fetch the protocol from the user's contact.
|
||||
$usercontact = Contact::getById($data['user'], ['network', 'protocol']);
|
||||
if ($this->db->isResult($usercontact)) {
|
||||
$contact['network'] = $usercontact['network'];
|
||||
$contact['protocol'] = $usercontact['protocol'];
|
||||
if ($data['user']) {
|
||||
$usercontact = Contact::getById($data['user'], ['network', 'protocol']);
|
||||
if ($this->db->isResult($usercontact)) {
|
||||
$contact['network'] = $usercontact['network'];
|
||||
$contact['protocol'] = $usercontact['protocol'];
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($contact['network']) && Contact::isLocal($contact['url']) ) {
|
||||
|
@ -177,7 +179,7 @@ class Profile extends BaseModule
|
|||
}
|
||||
|
||||
// Don't display contacts that are about to be deleted
|
||||
if ($this->db->isResult($contact) && (!empty($contact['deleted']) || !empty($contact['network']) && $contact['network'] == Protocol::PHANTOM)) {
|
||||
if ($contact['deleted'] || $contact['network'] == Protocol::PHANTOM) {
|
||||
throw new HTTPException\NotFoundException($this->t('Contact not found.'));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue