summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcube_vcard.php7
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], '@'))));
+ }
}