diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-05-12 20:18:19 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2011-05-12 20:18:19 +0000 |
| commit | 0060963927d992e06410aad4bf088b246f970a04 (patch) | |
| tree | ed4fd9bc466a12e6a6e0e81906c4426ed335e032 /roundcubemail/program/include/rcube_vcard.php | |
| parent | 61d95b9ca704b8306c99febb363fb0df8b1748d1 (diff) | |
Improve display name composition when saving contacts (#1487143), with plugin-support; allow empty names in sql address book, fall back to e-mail address in listing and vcard export
git-svn-id: https://svn.roundcube.net/trunk@4752 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_vcard.php')
| -rw-r--r-- | roundcubemail/program/include/rcube_vcard.php | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/roundcubemail/program/include/rcube_vcard.php b/roundcubemail/program/include/rcube_vcard.php index 0cb0b2051..4457bf3c9 100644 --- a/roundcubemail/program/include/rcube_vcard.php +++ b/roundcubemail/program/include/rcube_vcard.php @@ -115,13 +115,6 @@ class rcube_vcard $this->email[0] = $this->email[$pref_index]; $this->email[$pref_index] = $tmp; } - - // make sure displayname is not empty (required by RFC2426) - if (!strlen($this->displayname)) { - // the same method is used in steps/mail/addcontact.inc - $this->displayname = ucfirst(preg_replace('/[\.\-]/', ' ', - substr($this->email[0], 0, strpos($this->email[0], '@')))); - } } @@ -585,6 +578,10 @@ class rcube_vcard while ($type == "N" && is_array($entries[0]) && count($entries[0]) < 5) $entries[0][] = ""; + // make sure FN is not empty (required by RFC2426) + if ($type == "FN" && empty($entries)) + $entries[0] = $data['EMAIL'][0][0]; + foreach((array)$entries as $entry) { $attr = ''; if (is_array($entry)) { |
