From 697d36c7d199ac9f8abe2c02d9c44c27616a45eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 25 Apr 2023 20:31:49 +0200 Subject: [PATCH 1/2] fix warning --- htdocs/core/lib/company.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 7f051a1672e..20a4ffdafc1 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1040,7 +1040,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl 'label'=>$extrafields->attributes[$contactstatic->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$contactstatic->table_element]['list'][$key] < 0) ? 0 : 1), 'position'=>1000 + $extrafields->attributes[$contactstatic->table_element]['pos'][$key], - 'enabled'=>(abs($extrafields->attributes[$contactstatic->table_element]['list'][$key]) != 3 && $extrafields->attributes[$contactstatic->table_element]['perms'][$key])); + 'enabled'=>(abs((int) $extrafields->attributes[$contactstatic->table_element]['list'][$key]) != 3 && $extrafields->attributes[$contactstatic->table_element]['perms'][$key])); } } } From 244a986baf74e7be662055ac8c0d822c9786987f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Thu, 27 Apr 2023 09:21:56 +0200 Subject: [PATCH 2/2] fix eval --- htdocs/core/lib/company.lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 20a4ffdafc1..0a10d195e06 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1038,9 +1038,10 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl if (!empty($extrafields->attributes[$contactstatic->table_element]['list'][$key])) { $arrayfields["ef.".$key] = array( 'label'=>$extrafields->attributes[$contactstatic->table_element]['label'][$key], - 'checked'=>(($extrafields->attributes[$contactstatic->table_element]['list'][$key] < 0) ? 0 : 1), + 'checked'=>((dol_eval($extrafields->attributes[$contactstatic->table_element]['list'][$key], 1, 1, '1') < 0) ? 0 : 1), 'position'=>1000 + $extrafields->attributes[$contactstatic->table_element]['pos'][$key], - 'enabled'=>(abs((int) $extrafields->attributes[$contactstatic->table_element]['list'][$key]) != 3 && $extrafields->attributes[$contactstatic->table_element]['perms'][$key])); + 'enabled' => (abs((int) dol_eval($extrafields->attributes[$contactstatic->table_element]['list'][$key], 1)) != 3 && dol_eval($extrafields->attributes[$contactstatic->table_element]['perms'][$key], 1, 1, '1')) + ); } } }