From 62dfcbb07436b69ae3965458cd0dd0855992d33f Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 19 May 2019 18:46:58 -0400 Subject: [PATCH] Prevent contact relationships with node- or user-level blocked contacts --- src/Model/Contact.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 18b60d2121..625c66b199 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -2137,13 +2137,18 @@ class Contact extends BaseObject return false; } - $fields = ['url', 'name', 'nick', 'photo', 'network']; + $fields = ['url', 'name', 'nick', 'photo', 'network', 'blocked']; $pub_contact = DBA::selectFirst('contact', $fields, ['id' => $datarray['author-id']]); if (!DBA::isResult($pub_contact)) { // Should never happen return false; } + // Contact is blocked on node-level or user-level + if (!empty($pub_contact['blocked']) || !empty($contact['blocked'])) { + return false; + } + $url = defaults($datarray, 'author-link', $pub_contact['url']); $name = $pub_contact['name']; $photo = $pub_contact['photo']; -- 2.39.5