From 42b9b6a2f134a37c56fa552d495d13f18b2f53a6 Mon Sep 17 00:00:00 2001 From: fabrixxm Date: Thu, 18 Mar 2021 14:11:32 +0100 Subject: [PATCH] PM: skip messages from missing contacts avoid the White Page of Death if a private message (mail) is pointing to a non existing contact. --- mod/message.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mod/message.php b/mod/message.php index 22283d8e88..2b699dac0e 100644 --- a/mod/message.php +++ b/mod/message.php @@ -451,6 +451,11 @@ function render_messages(array $msg, $t) $body_e = $rr['body']; $to_name_e = $rr['name']; + if (is_null($rr['url'])) { + // contact-id is pointing to a non existing contact + continue; + } + $contact = Contact::getByURL($rr['url'], false, ['thumb', 'addr', 'id', 'avatar']); $from_photo = Contact::getThumb($contact, $rr['thumb'] ?: $rr['from-photo']);