diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e6852cdde03..bca479dd910 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2951,7 +2951,7 @@ function dol_print_socialnetworks($value, $cid, $socid, $type, $dictsocialnetwor } else { if (!empty($dictsocialnetworks[$type]['url'])) { $link = str_replace('{socialid}', $value, $dictsocialnetworks[$type]['url']); - $htmllink .= ' '.dol_escape_htmltag($value).''; + $htmllink .= ' '.dol_escape_htmltag($value).''; } else { $htmllink .= dol_escape_htmltag($value); } diff --git a/htdocs/core/modules/import/import_csv.modules.php b/htdocs/core/modules/import/import_csv.modules.php index 0ca104c40c4..eef7305e1bc 100644 --- a/htdocs/core/modules/import/import_csv.modules.php +++ b/htdocs/core/modules/import/import_csv.modules.php @@ -717,14 +717,16 @@ class ImportCsv extends ModeleImports $socialkey = array_search("socialnetworks", $listfields); if (empty($listvalues[$socialkey]) || $listvalues[$socialkey] == "null") { $socialnetwork = explode("_", $fieldname)[1]; - $newvalue = '\'{ "'.$socialnetwork.'" : "'.$this->db->escape($newval).'" }\''; - $listvalues[$socialkey] = $newvalue; + $json = new stdClass(); + $json->$socialnetwork = $newval; + $newvalue = json_encode($json); + $listvalues[$socialkey] = "'".$this->db->escape($newvalue)."'"; } else { $socialnetwork = explode("_", $fieldname)[1]; $jsondata = $listvalues[$socialkey]; $jsondata = str_replace("'", "", $jsondata); $json = json_decode($jsondata); - $json->$socialnetwork = $this->db->escape($newval); + $json->$socialnetwork = $newval; $listvalues[$socialkey] = "'".$this->db->escape(json_encode($json))."'"; } } diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php index f80cddf85e8..65985e6856a 100644 --- a/htdocs/core/modules/import/import_xlsx.modules.php +++ b/htdocs/core/modules/import/import_xlsx.modules.php @@ -760,7 +760,9 @@ class ImportXlsx extends ModeleImports $socialkey = array_search("socialnetworks", $listfields); if (empty($listvalues[$socialkey]) || $listvalues[$socialkey] == "null") { $socialnetwork = explode("_", $fieldname)[1]; - $newvalue = '\'{ "'.$socialnetwork.'" : "'.$this->db->escape($newval).'" }\''; + $json = new stdClass(); + $json->$socialnetwork = $newval; + $newvalue = json_encode($json); $listvalues[$socialkey] = $newvalue; } else { $socialnetwork = explode("_", $fieldname)[1];