diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 9406c1e3ae5..48e92d58172 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1175,7 +1175,7 @@ abstract class CommonObject $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX."element_contact"; - $sql .= " WHERE rowid =".$rowid; + $sql .= " WHERE rowid = ".((int) $rowid); dol_syslog(get_class($this)."::delete_contact", LOG_DEBUG); if ($this->db->query($sql)) { diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index d1bcab57412..9d5b7c4a8af 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -99,7 +99,7 @@ if ($action == 'addcontact' && $user->rights->expedition->creer) { $result = $objectsrc->swapContactStatus(GETPOST('ligne', 'int')); } elseif ($action == 'deletecontact' && $user->rights->expedition->creer) { // Efface un contact - $result = $objectsrc->delete_contact(GETPOST("lineid")); + $result = $objectsrc->delete_contact(GETPOST("lineid", 'int')); if ($result >= 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); diff --git a/htdocs/projet/contact.php b/htdocs/projet/contact.php index fe434891fa9..92f4e4e3b15 100644 --- a/htdocs/projet/contact.php +++ b/htdocs/projet/contact.php @@ -223,7 +223,7 @@ if ($action == 'swapstatut' && $user->rights->projet->creer) { // Delete a contact if (($action == 'deleteline' || $action == 'deletecontact') && $user->rights->projet->creer) { $object->fetch($id); - $result = $object->delete_contact(GETPOST("lineid")); + $result = $object->delete_contact(GETPOST("lineid", 'int')); if ($result >= 0) { header("Location: contact.php?id=".$object->id); diff --git a/htdocs/reception/contact.php b/htdocs/reception/contact.php index 58e046ec0bb..3caa9a90fea 100644 --- a/htdocs/reception/contact.php +++ b/htdocs/reception/contact.php @@ -110,7 +110,7 @@ if ($action == 'addcontact' && $user->rights->reception->creer) { $result = $objectsrc->swapContactStatus(GETPOST('ligne', 'int')); } elseif ($action == 'deletecontact' && $user->rights->reception->creer) { // Efface un contact - $result = $objectsrc->delete_contact(GETPOST("lineid")); + $result = $objectsrc->delete_contact(GETPOST("lineid", 'int')); if ($result >= 0) { header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index 5ab07cdd536..4979a883d9c 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -410,7 +410,7 @@ class Dolresource extends CommonObject $this->db->begin(); $sql = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element; - $sql .= " WHERE rowid =".$rowid; + $sql .= " WHERE rowid = ".((int) $rowid); dol_syslog(get_class($this), LOG_DEBUG); if ($this->db->query($sql)) {