From bec559aae9406eca2171cfb4b6926ad756563709 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 15 Jan 2023 02:16:35 +0100 Subject: [PATCH] Try to fix social network inks in vcard --- htdocs/core/class/vcard.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/vcard.class.php b/htdocs/core/class/vcard.class.php index f6c8d14979b..c66974f939b 100644 --- a/htdocs/core/class/vcard.class.php +++ b/htdocs/core/class/vcard.class.php @@ -359,7 +359,8 @@ class vCard $text .= "VERSION:4.0\r\n"; // With V4, all encoding are UTF-8 //$text.= "VERSION:2.1\r\n"; foreach ($this->properties as $key => $value) { - $text .= $key.":".$value."\r\n"; + $newkey = preg_replace('/-.*$/', '', $key); // remove suffix -twitter, -facebook, ... + $text .= $newkey.":".$value."\r\n"; } $text .= "REV:".date("Ymd")."T".date("His")."Z\r\n"; //$text .= "MAILER: Dolibarr\r\n"; @@ -441,7 +442,7 @@ class vCard } } if ($urlsn) { - $this->properties["SOCIALPROFILE;TYPE=home"] = $key.':'.$urlsn; + $this->properties["SOCIALPROFILE;TYPE=home-".$key] = $key.':'.$urlsn; } } }