diff options
| author | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-04-12 11:52:09 +0000 |
|---|---|---|
| committer | alec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2012-04-12 11:52:09 +0000 |
| commit | e2787e1a6d649494122250acf63cb2ff88509cae (patch) | |
| tree | e20a12ecb28f2afcfbfc2d1ffb326f234a997c41 /roundcubemail/program/steps | |
| parent | c07116f6b7517e083a6e423a1de1967916a0af76 (diff) | |
- Fix importing to LDAP addressbook when mail attribute is required by
validating input data with autofix
git-svn-id: https://svn.roundcube.net/trunk@6067 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/steps')
| -rw-r--r-- | roundcubemail/program/steps/addressbook/import.inc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/roundcubemail/program/steps/addressbook/import.inc b/roundcubemail/program/steps/addressbook/import.inc index 7b52bdcee..018c980eb 100644 --- a/roundcubemail/program/steps/addressbook/import.inc +++ b/roundcubemail/program/steps/addressbook/import.inc @@ -164,10 +164,11 @@ if ($_FILES['_file']['tmp_name'] && is_uploaded_file($_FILES['_file']['tmp_name' $CONTACTS->delete_all(); foreach ($vcards as $vcard) { - $email = $vcard->email[0]; + $email = $vcard->email[0]; + $a_record = $vcard->get_assoc(); - // skip entries without an e-mail address - if (empty($email)) { + // skip entries without an e-mail address or invalid + if (empty($email) || !$CONTACTS->validate($a_record, true)) { $IMPORT_STATS->nomail++; continue; } @@ -188,7 +189,6 @@ if ($_FILES['_file']['tmp_name'] && is_uploaded_file($_FILES['_file']['tmp_name' } } - $a_record = $vcard->get_assoc(); $a_record['vcard'] = $vcard->export(); $plugin = $RCMAIL->plugins->exec_hook('contact_create', array('record' => $a_record, 'source' => null)); |
