1
1
Fork 0

Merge pull request #7243 from nupplaphil/bugs/6918-php_notices

Check Contact ID (fix PHP notice)
This commit is contained in:
Hypolite Petovan 2019-06-10 08:01:28 -04:00 committed by GitHub
commit 1818aca1b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -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;
}

View file

@ -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.