diff options
author | alecpl <alec@alec.pl> | 2010-08-04 08:15:17 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2010-08-04 08:15:17 +0000 |
commit | c56f1f5046e1c4f66384197ecf163d60751667f4 (patch) | |
tree | f7fb6f34e88ca20724c60be8ad2e98d1a6732c24 /program | |
parent | 367da9c1d3be7b2196beb6021fe14844e527b2b1 (diff) |
- Support vCards without or with an empty FN
Diffstat (limited to 'program')
-rw-r--r-- | program/include/rcube_vcard.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/program/include/rcube_vcard.php b/program/include/rcube_vcard.php index 320607b6e..0ed7be7f5 100644 --- a/program/include/rcube_vcard.php +++ b/program/include/rcube_vcard.php @@ -86,6 +86,13 @@ 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], '@')))); + } } |