From cbf6fe1f6282e69fe04dd550cae646af3cade65c Mon Sep 17 00:00:00 2001 From: Francis Appels Date: Sun, 3 Jan 2021 11:42:11 +0100 Subject: [PATCH] Clean code --- htdocs/expedition/contact.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/contact.php b/htdocs/expedition/contact.php index 09559a64a2c..c5d74a2f39d 100644 --- a/htdocs/expedition/contact.php +++ b/htdocs/expedition/contact.php @@ -80,7 +80,9 @@ if ($action == 'addcontact' && $user->rights->expedition->creer) { if ($result > 0 && $id > 0) { - $result = $objectsrc->add_contact(GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'), GETPOST('type') ? GETPOST('type') : GETPOST('typecontact'), GETPOST('source')); + $contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int')); + $typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type')); + $result = $objectsrc->add_contact($contactid, $typeid, GETPOST("source", 'aZ09')); } if ($result >= 0)