diff options
author | thomascube <thomas@roundcube.net> | 2011-05-12 20:18:19 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2011-05-12 20:18:19 +0000 |
commit | e848180aaa9640de871796ca1a3e4f8110701fd6 (patch) | |
tree | 8691c816c9c8ddd4ad8ef733cc61a8bc52541cc3 /program/include/rcube_vcard.php | |
parent | caedd52361f8ba15aa6bfbc00cab7f55525f5edf (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
Diffstat (limited to 'program/include/rcube_vcard.php')
-rw-r--r-- | program/include/rcube_vcard.php | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/program/include/rcube_vcard.php b/program/include/rcube_vcard.php index 0cb0b2051..4457bf3c9 100644 --- a/program/include/rcube_vcard.php +++ b/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)) { |