From 7c7f80fb59e98310cfced589d1cd518d2e3a3307 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Mon, 18 Jan 2021 17:05:15 +0100 Subject: [PATCH] update pull request with sql in simple quotes --- htdocs/user/class/user.class.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 350ee81ec11..cf0172b9e37 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1417,13 +1417,15 @@ class User extends CommonObject // Create user and set $this->id. Trigger is disabled because executed later. $result = $this->create($user, 1); if ($result > 0) { - $sql = "UPDATE ".MAIN_DB_PREFIX."user"; - $sql .= " SET fk_socpeople=".$contact->id; - $sql .= ", civility=\"".$contact->civility_code."\""; + $sql = 'UPDATE '.MAIN_DB_PREFIX.'user'; + $sql .= ' SET fk_socpeople='.$contact->id; + $sql .= ', civility="'.$contact->civility_code.'"'; if ($contact->socid) { - $sql .= ", fk_soc=".$contact->socid; + $sql .= ', fk_soc='.$contact->socid; } - $sql .= " WHERE rowid=".$this->id; + $sql .= ' WHERE rowid='.$this->id; + print var_dump($sql); + $resql = $this->db->query($sql); dol_syslog(get_class($this)."::create_from_contact", LOG_DEBUG);