From 236c0dc248d34d74b25be78602f23dccdb7ce2d7 Mon Sep 17 00:00:00 2001 From: Philipp Holzer Date: Mon, 10 Jun 2019 12:36:42 +0200 Subject: [PATCH] Check $contact['id'] - see https://github.com/friendica/friendica/issues/6918#issuecomment-498043313 --- src/Model/Contact.php | 3 ++- src/Protocol/DFRN.php | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index a0bbdd1049..7e1d8c2ba5 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -2157,7 +2157,8 @@ class Contact extends BaseObject if (!empty($contact)) { // Contact is blocked at user-level - if (self::isBlockedByUser($contact['id'], $importer['id'])) { + if (!empty($contact['id']) && !empty($importer['id']) && + self::isBlockedByUser($contact['id'], $importer['id'])) { return false; } diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index fe2a608ec6..ec4557e822 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -2216,11 +2216,10 @@ class DFRN { Logger::log("Process verb ".$item["verb"]." and object-type ".$item["object-type"]." for entrytype ".$entrytype, Logger::DEBUG); - if (($entrytype == DFRN::TOP_LEVEL)) { + if (($entrytype == DFRN::TOP_LEVEL) && !empty($importer['id'])) { // The filling of the the "contact" variable is done for legcy reasons // The functions below are partly used by ostatus.php as well - where we have this variable - $r = q("SELECT * FROM `contact` WHERE `id` = %d", intval($importer["id"])); - $contact = $r[0]; + $contact = Contact::select([], ['id' => $importer['id']]); // Big question: Do we need these functions? They were part of the "consume_feed" function. // This function once was responsible for DFRN and OStatus. -- 2.39.5