summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-08-04 08:15:17 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2010-08-04 08:15:17 +0000
commit00e6fd49929bb4a15eef004a4187163732ac8c3f (patch)
tree0753e6b220a706f6f5c0b5ec0a858fc088419bc6 /roundcubemail/program/include
parent421c486484a27c8196d50f15f864e94b99317d86 (diff)
- Support vCards without or with an empty FN
git-svn-id: https://svn.roundcube.net/trunk@3863 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
-rw-r--r--roundcubemail/program/include/rcube_vcard.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/roundcubemail/program/include/rcube_vcard.php b/roundcubemail/program/include/rcube_vcard.php
index 320607b6e..0ed7be7f5 100644
--- a/roundcubemail/program/include/rcube_vcard.php
+++ b/roundcubemail/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], '@'))));
+ }
}