summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-05-13 18:08:37 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-05-13 18:08:37 +0000
commit7584077db7ee79d58df5021bb689a7deaae04cbb (patch)
tree14fa7911d5440b0e1032f0232677cf2235161721 /roundcubemail/program/include
parentf4938a7920c149bb3298298880530b514c99772f (diff)
Correctly handle empty contact names when importing
git-svn-id: https://svn.roundcube.net/trunk@4765 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
-rw-r--r--roundcubemail/program/include/rcube_vcard.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/roundcubemail/program/include/rcube_vcard.php b/roundcubemail/program/include/rcube_vcard.php
index 4457bf3c9..40ec353e5 100644
--- a/roundcubemail/program/include/rcube_vcard.php
+++ b/roundcubemail/program/include/rcube_vcard.php
@@ -95,6 +95,10 @@ class rcube_vcard
($detected_charset = self::detect_encoding(self::vcard_encode($this->raw))) && $detected_charset != RCMAIL_CHARSET) {
$this->raw = self::charset_convert($this->raw, $detected_charset);
}
+
+ // consider FN empty if the same as the primary e-mail address
+ if ($this->raw['FN'][0][0] == $this->raw['EMAIL'][0][0])
+ $this->raw['FN'][0][0] = '';
// find well-known address fields
$this->displayname = $this->raw['FN'][0][0];
@@ -402,7 +406,7 @@ class rcube_vcard
if (preg_match('/^END:VCARD$/i', $line)) {
// parse vcard
$obj = new rcube_vcard(self::cleanup($vcard_block), $charset, true);
- if (!empty($obj->displayname))
+ if (!empty($obj->displayname) || !empty($obj->email))
$out[] = $obj;
$in_vcard_block = false;