Fix importing contacts with no email address (#8227)

This commit is contained in:
Aleksander Machniak
2021-10-19 15:25:49 +02:00
parent 234fdbdd6c
commit 263003d006
3 changed files with 8 additions and 2 deletions

View File

@@ -23,6 +23,7 @@
- Password: Verify current password with IMAP (#8142)
- Password: Improve handling errors on executed commands (#8200)
- Fix locked SQLite database for the CLI tools (#8035)
- Fix importing contacts with no email address (#8227)
## Release 1.5.0

View File

@@ -196,8 +196,11 @@ class rcmail_action_contacts_import extends rcmail_action_contacts_index
}
// We're using UTF8 internally
$email = $vcard->email[0];
$email = rcube_utils::idn_to_utf8($email);
$email = null;
if (isset($vcard->email[0])) {
$email = $vcard->email[0];
$email = rcube_utils::idn_to_utf8($email);
}
if (!$replace) {
$existing = null;

View File

@@ -809,6 +809,8 @@ class rcube_contacts extends rcube_addressbook
// save all e-mails in the database column
if (!empty($vcard->email)) {
$out['email'] = implode(self::SEPARATOR, $vcard->email);
} else {
$out['email'] = isset($save_data['email']) ? $save_data['email'] : '';
}
// join words for fulltext search