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);
}
}
$updated = ['addr' => $data['addr'],
- 'alias' => $data['alias'],
+ 'alias' => defaults($data, 'alias', ''),
'url' => $data['url'],
'nurl' => Strings::normaliseLink($data['url']),
'name' => $data['name'],
$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"])) {