From 934070f14e0393859bb804298ad6747126ada4c3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 19 Jan 2021 10:56:46 +0100 Subject: [PATCH] Backport FIx #15970 --- htdocs/user/class/user.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 7f9c87ab7a7..89c13670890 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1452,11 +1452,11 @@ class User extends CommonObject if ($result > 0) { $sql = "UPDATE ".MAIN_DB_PREFIX."user"; $sql .= " SET fk_socpeople=".$contact->id; - $sql .= ", civility=".$contact->civility_code; - if ($contact->socid) { + $sql .= ", civility='".$this->db->escape($contact->civility_code)."'"; + if ($contact->socid > 0) { $sql .= ", fk_soc=".$contact->socid; } - $sql .= " WHERE rowid=".$this->id; + $sql .= " WHERE rowid=".((int) $this->id); $resql = $this->db->query($sql); dol_syslog(get_class($this)."::create_from_contact", LOG_DEBUG);