From 95e3c9eff7623793d1514320a570cda7386f728d Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 9 Jun 2023 15:12:34 +0200 Subject: [PATCH 1/2] fix: VCARD RFC 6350 comformity --- htdocs/core/class/vcard.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/vcard.class.php b/htdocs/core/class/vcard.class.php index 0bb532e33c4..69c14695cf7 100644 --- a/htdocs/core/class/vcard.class.php +++ b/htdocs/core/class/vcard.class.php @@ -260,14 +260,14 @@ class vCard * Add a e-mail address to this vCard * * @param string $address E-mail address - * @param string $type (optional) The type of the e-mail (typical "PREF;INTERNET" or "INTERNET") + * @param string $type (optional) The type of the e-mail (typical "PREF" or "INTERNET") * @return void */ public function setEmail($address, $type = "") { $key = "EMAIL"; if ($type != "") { - $key .= ";".$type; + $key .= ";TYPE=".dol_strtolower($type); } $this->properties[$key] = $address; } From 635b5efcca3f2fb966308323e9a27b368e7d84a1 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 9 Jun 2023 15:15:48 +0200 Subject: [PATCH 2/2] reveiw from spec --- htdocs/core/class/vcard.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/vcard.class.php b/htdocs/core/class/vcard.class.php index 69c14695cf7..e2694520577 100644 --- a/htdocs/core/class/vcard.class.php +++ b/htdocs/core/class/vcard.class.php @@ -266,7 +266,9 @@ class vCard public function setEmail($address, $type = "") { $key = "EMAIL"; - if ($type != "") { + if ($type == "PREF") { + $key .= ";PREF=1"; + } elseif (!empty($type)) { $key .= ";TYPE=".dol_strtolower($type); } $this->properties[$key] = $address;