From c56f1f5046e1c4f66384197ecf163d60751667f4 Mon Sep 17 00:00:00 2001 From: alecpl Date: Wed, 4 Aug 2010 08:15:17 +0000 Subject: - Support vCards without or with an empty FN --- program/include/rcube_vcard.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'program') 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], '@')))); + } } -- cgit v1.2.3