Merge pull request #25027 from FHenry/dev_fix_vcard_RFC6350

fix: VCARD RFC 6350 conformity
This commit is contained in:
Laurent Destailleur 2023-06-09 15:36:54 +02:00 committed by GitHub
commit d4d2efa40e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -260,14 +260,16 @@ 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;
if ($type == "PREF") {
$key .= ";PREF=1";
} elseif (!empty($type)) {
$key .= ";TYPE=".dol_strtolower($type);
}
$this->properties[$key] = $address;
}