diff options
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)) { |