From 14725bbd6aca29c2c6442936bfcb37f9c743c96a Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 15 Jun 2019 17:16:10 -0400 Subject: [PATCH] Fix undefined index addr notices in Model\Contact::getIdForURL - Addresses https://github.com/friendica/friendica/issues/6918#issuecomment-502393030 --- src/Model/Contact.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 01bbd23a6d..a7914a190b 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1463,12 +1463,14 @@ class Contact extends BaseObject return $contact_id; } - $updated = ['addr' => $data['addr'], + $updated = [ + 'addr' => $data['addr'] ?? '', 'alias' => defaults($data, 'alias', ''), 'url' => $data['url'], 'nurl' => Strings::normaliseLink($data['url']), 'name' => $data['name'], - 'nick' => $data['nick']]; + 'nick' => $data['nick'] + ]; if (!empty($data['keywords'])) { $updated['keywords'] = $data['keywords']; @@ -1502,7 +1504,7 @@ class Contact extends BaseObject $updated['pubkey'] = $data['pubkey']; } - if (($data['addr'] != $contact['addr']) || (!empty($data['alias']) && ($data['alias'] != $contact['alias']))) { + if (($updated['addr'] != $contact['addr']) || (!empty($data['alias']) && ($data['alias'] != $contact['alias']))) { $updated['uri-date'] = DateTimeFormat::utcNow(); } if (($data["name"] != $contact["name"]) || ($data["nick"] != $contact["nick"])) {