From: Michael Date: Tue, 9 Apr 2019 17:58:28 +0000 (+0000) Subject: Fix warnings X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4e9316fc157fb329fa8225b4b1a7731317789bd2;p=friendica.git Fix warnings --- diff --git a/src/Model/Contact.php b/src/Model/Contact.php index a866df91c5..bdddf5cfa2 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1316,7 +1316,7 @@ class Contact extends BaseObject return 0; } - if (!$contact_id && ($data["alias"] != '') && ($data["alias"] != $url) && !$in_loop) { + if (!$contact_id && !empty($data['alias']) && ($data['alias'] != $url) && !$in_loop) { $contact_id = self::getIdForURL($data["alias"], $uid, true, $default, true); } @@ -1406,7 +1406,7 @@ class Contact extends BaseObject } $updated = ['addr' => $data['addr'], - 'alias' => $data['alias'], + 'alias' => defaults($data, 'alias', ''), 'url' => $data['url'], 'nurl' => Strings::normaliseLink($data['url']), 'name' => $data['name'], @@ -1444,7 +1444,7 @@ class Contact extends BaseObject $updated['pubkey'] = $data['pubkey']; } - if (($data["addr"] != $contact["addr"]) || ($data["alias"] != $contact["alias"])) { + if (($data['addr'] != $contact['addr']) || (!empty($data['alias']) && ($data['alias'] != $contact['alias']))) { $updated['uri-date'] = DateTimeFormat::utcNow(); } if (($data["name"] != $contact["name"]) || ($data["nick"] != $contact["nick"])) {