diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index dcffab2e452..dc27e946daf 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -134,7 +134,7 @@ if ($id) { $permissiontoeditextra = $canaddmember; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } // Security check diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index f340bf88c3d..2ddc16c77d9 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -208,7 +208,7 @@ foreach ($object->fields as $key => $val) { $arrayfields[$tableprefix.'.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? '0' : '1'), - 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => (int) $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/admin/emailcollector_list.php b/htdocs/admin/emailcollector_list.php index f60aa76e109..5b7d4c92f0a 100644 --- a/htdocs/admin/emailcollector_list.php +++ b/htdocs/admin/emailcollector_list.php @@ -132,7 +132,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php index 155acb37f74..ac497d3d4d4 100644 --- a/htdocs/admin/mails_senderprofile_list.php +++ b/htdocs/admin/mails_senderprofile_list.php @@ -119,7 +119,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 675f3370e38..c51b668cae4 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -1230,7 +1230,7 @@ if ($num) { continue; // It means this is a type of template not into elementList (may be because enabled condition of this type is false because module is not enabled) } // Test on 'enabled' - if (! (int) dol_eval($obj->enabled, 1, 1, '1')) { + if (! (int) dol_eval((string) $obj->enabled, 1, 1, '1')) { $i++; continue; // Email template not qualified } diff --git a/htdocs/admin/menus/edit.php b/htdocs/admin/menus/edit.php index fd3961e81a5..7f2fa72a24a 100644 --- a/htdocs/admin/menus/edit.php +++ b/htdocs/admin/menus/edit.php @@ -560,7 +560,7 @@ if ($action == 'create') { print ''.$langs->trans('Enabled').''; print ''.$langs->trans('DetailEnabled'); if (!empty($menu->enabled)) { - print ' ('.$langs->trans("ConditionIsCurrently").': '.yn((int) dol_eval($menu->enabled, 1, 1, '1') <= 0 ? 0 : 1).')'; + print ' ('.$langs->trans("ConditionIsCurrently").': '.yn((int) dol_eval((string) $menu->enabled, 1, 1, '1') <= 0 ? 0 : 1).')'; } print ''; @@ -568,7 +568,7 @@ if ($action == 'create') { print ''.$langs->trans('Rights').''; print ''.$langs->trans('DetailRight'); if (!empty($menu->perms)) { - print ' ('.$langs->trans("ConditionIsCurrently").': '.yn((int) dol_eval($menu->perms, 1, 1, '1') <= 0 ? 0 : 1).')'; + print ' ('.$langs->trans("ConditionIsCurrently").': '.yn((int) dol_eval((string) $menu->perms, 1, 1, '1') <= 0 ? 0 : 1).')'; } print ''; diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php index dfdcd5d4b16..9baa13c350e 100644 --- a/htdocs/asset/list.php +++ b/htdocs/asset/list.php @@ -123,7 +123,7 @@ foreach ($object->fields as $key => $val) { $arrayfields[$tableprefix.'.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php index 1a89fb52c2d..afecb929d28 100644 --- a/htdocs/asset/model/list.php +++ b/htdocs/asset/model/list.php @@ -120,7 +120,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/asset/tpl/depreciation_options_edit.tpl.php b/htdocs/asset/tpl/depreciation_options_edit.tpl.php index e61443e23c3..e7fb3fbc473 100644 --- a/htdocs/asset/tpl/depreciation_options_edit.tpl.php +++ b/htdocs/asset/tpl/depreciation_options_edit.tpl.php @@ -158,7 +158,7 @@ if (empty($reshook)) { } $value = GETPOSTISSET($html_name) ? GETPOST($html_name, $check) : $assetdepreciationoptions->$field_key; } elseif ($field_info['type'] == 'price') { - $value = GETPOSTISSET($html_name) ? price2num(GETPOST($html_name)) : ($assetdepreciationoptions->$field_key ? price2num($assetdepreciationoptions->$field_key) : (!empty($field_info['default']) ? dol_eval($field_info['default'], 1) : 0)); + $value = GETPOSTISSET($html_name) ? price2num(GETPOST($html_name)) : ($assetdepreciationoptions->$field_key ? price2num($assetdepreciationoptions->$field_key) : (!empty($field_info['default']) ? dol_eval((string) $field_info['default'], 1) : 0)); } elseif ($field_key == 'lang') { $value = GETPOSTISSET($html_name) ? GETPOST($html_name, 'aZ09') : $assetdepreciationoptions->lang; } else { diff --git a/htdocs/bom/bom_list.php b/htdocs/bom/bom_list.php index 4faf0ce8fa1..334152c7dc9 100644 --- a/htdocs/bom/bom_list.php +++ b/htdocs/bom/bom_list.php @@ -120,7 +120,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index 8402ef70b03..09769d9ecdd 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -135,7 +135,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/bookcal/calendar_list.php b/htdocs/bookcal/calendar_list.php index 05f1367d3b7..03e079b68b8 100644 --- a/htdocs/bookcal/calendar_list.php +++ b/htdocs/bookcal/calendar_list.php @@ -133,7 +133,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 633c1440404..582447b1e77 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -163,7 +163,7 @@ $permissiontoadd = $user->hasRight('societe', 'creer'); $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } diff --git a/htdocs/comm/mailing/targetemailing.php b/htdocs/comm/mailing/targetemailing.php index bb07fb3c7d2..d098b97faca 100644 --- a/htdocs/comm/mailing/targetemailing.php +++ b/htdocs/comm/mailing/targetemailing.php @@ -576,7 +576,7 @@ if ($object->fetch($id) >= 0) { '@phan-var-force MailingTargets $obj'; // Check if qualified - $qualified = (is_null($obj->enabled) ? 1 : (int) dol_eval($obj->enabled, 1)); + $qualified = (is_null($obj->enabled) ? 1 : (int) dol_eval((string) $obj->enabled, 1)); // Check dependencies foreach ($obj->require_module as $key) { diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index a92bc31a868..888e0ba3a6e 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -154,7 +154,7 @@ $permissiontoedit = $usercancreate; // Used by the include of actions_lineupdown $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } $price_base_type = null; diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index e15f131b167..11c353bb13d 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -289,7 +289,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index a90c37cc6aa..25fc87772b5 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -168,7 +168,7 @@ $permissiontoadd = $usercancreate; // Used by the include of actions_addu $permissiontoeditextra = $usercancreate; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } $error = 0; diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php index 3b4182dc013..d342afd0fed 100644 --- a/htdocs/compta/facture/card-rec.php +++ b/htdocs/compta/facture/card-rec.php @@ -129,7 +129,7 @@ $permissiontoedit = $user->hasRight('facture', 'creer'); // Used by the include $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } $usercanread = $user->hasRight('facture', 'lire'); diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 489763b87b0..57c0afb1c55 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -187,7 +187,7 @@ $permissiontoadd = $usercancreate; // Used by the include of actions_addupdatede $permissiontoeditextra = $usercancreate; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } // retained warranty invoice available type diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 5fea735544c..823f331a345 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2383,7 +2383,7 @@ class Facture extends CommonInvoice if (empty($conf->disable_compute)) { global $objectoffield; $objectoffield = $this; - $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); + $this->array_options['options_' . $key] = dol_eval((string) $extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); } } } @@ -2604,7 +2604,7 @@ class Facture extends CommonInvoice if (empty($conf->disable_compute)) { global $objectoffield; $objectoffield = $line; - $line->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element_line]['computed'][$key], 1, 0, '2'); + $line->array_options['options_' . $key] = dol_eval((string) $extrafields->attributes[$this->table_element_line]['computed'][$key], 1, 0, '2'); } } } diff --git a/htdocs/compta/facture/class/factureligne.class.php b/htdocs/compta/facture/class/factureligne.class.php index ed0a80d3a22..39aa86430a8 100644 --- a/htdocs/compta/facture/class/factureligne.class.php +++ b/htdocs/compta/facture/class/factureligne.class.php @@ -368,7 +368,7 @@ class FactureLigne extends CommonInvoiceLine if (empty($conf->disable_compute)) { global $objectoffield; $objectoffield = $this; - $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); + $this->array_options['options_' . $key] = dol_eval((string) $extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); } } } diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 68e9df96c8e..baea1b1513a 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -323,7 +323,7 @@ foreach ($object->fields as $key => $val) { $arrayfields[$newkey] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? '0' : '1'), - 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => empty($val['help']) ? '' : $val['help'], ); diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 15b40eb10ed..09328db8ca3 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -388,7 +388,7 @@ if ($modecompta == 'CREANCES-DETTES') { } else { //var_dump($result); //$r = $AccCat->calculate($result); - $r = (float) dol_eval($result, 1, 1, '1'); + $r = (float) dol_eval((string) $result, 1, 1, '1'); if (getDolGlobalInt('ACCOUNTANCY_TRUNC_DECIMAL_ON_BALANCE_REPORT')) { print ''.price($r, 0, '', 1, 0, 0).''; @@ -419,7 +419,7 @@ if ($modecompta == 'CREANCES-DETTES') { $result = str_replace('--', '+', $result); //$r = $AccCat->calculate($result); - $r = (float) dol_eval($result, 1, 1, '1'); + $r = (float) dol_eval((string) $result, 1, 1, '1'); if (getDolGlobalInt('ACCOUNTANCY_TRUNC_DECIMAL_ON_BALANCE_REPORT')) { print ''.price($r, 0, '', 1, 0, 0).''; @@ -442,7 +442,7 @@ if ($modecompta == 'CREANCES-DETTES') { $result = str_replace('--', '+', $result); //$r = $AccCat->calculate($result); - $r = (float) dol_eval($result, 1, 1, '1'); + $r = (float) dol_eval((string) $result, 1, 1, '1'); if (getDolGlobalInt('ACCOUNTANCY_TRUNC_DECIMAL_ON_BALANCE_REPORT')) { @@ -468,7 +468,7 @@ if ($modecompta == 'CREANCES-DETTES') { $result = str_replace('--', '+', $result); //$r = $AccCat->calculate($result); - $r = (float) dol_eval($result, 1, 1, '1'); + $r = (float) dol_eval((string) $result, 1, 1, '1'); if (getDolGlobalInt('ACCOUNTANCY_TRUNC_DECIMAL_ON_BALANCE_REPORT')) { print ''.price($r, 0, '', 1, 0, 0).''; diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 910f889cec9..9aaacf211ca 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -111,7 +111,7 @@ $permissiontoadd = $user->hasRight('societe', 'contact', 'creer'); $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } // Security check diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 0c77c11cc57..7923c01d876 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -238,7 +238,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['p.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? '0' : '1'), - 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 809b7df84ef..524722f10ad 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -134,7 +134,7 @@ $permissiontodisable = $user->hasRight('contrat', 'desactiver'); // TODO use sam $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } $error = 0; diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php index 41b70a4bf3e..040bd2f8a1c 100644 --- a/htdocs/core/actions_addupdatedelete.inc.php +++ b/htdocs/core/actions_addupdatedelete.inc.php @@ -427,7 +427,7 @@ if (preg_match('/^set(\w+)$/', $action, $reg) && GETPOSTINT('id') > 0 && !empty( $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } if ($action == "update_extras" && GETPOSTINT('id') > 0 && !empty($permissiontoeditextra)) { diff --git a/htdocs/core/boxes/box_scheduled_jobs.php b/htdocs/core/boxes/box_scheduled_jobs.php index cf1d6f683fe..e958acf5fbe 100644 --- a/htdocs/core/boxes/box_scheduled_jobs.php +++ b/htdocs/core/boxes/box_scheduled_jobs.php @@ -93,7 +93,7 @@ class box_scheduled_jobs extends ModeleBoxes while ($i < $num) { $objp = $this->db->fetch_object($result); - if ((int) dol_eval($objp->test, 1, 1, '2')) { + if ((int) dol_eval((string) $objp->test, 1, 1, '2')) { $nextrun = $this->db->jdate($objp->datenextrun); if (empty($nextrun)) { $nextrun = $this->db->jdate($objp->datestart); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 98201e8e6fd..cea1d2e1b91 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1014,11 +1014,11 @@ abstract class CommonObject $enabled = (int) dol_eval((string) $extrafields->attributes[$this->table_element]['enabled'][$key], 1, 1, '2'); } if ($enabled && isset($extrafields->attributes[$this->table_element]['list'][$key])) { - $enabled = (int) dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1, 1, '2'); + $enabled = (int) dol_eval((string) $extrafields->attributes[$this->table_element]['list'][$key], 1, 1, '2'); } $perms = 1; if ($perms && isset($extrafields->attributes[$this->table_element]['perms'][$key])) { - $perms = (int) dol_eval($extrafields->attributes[$this->table_element]['perms'][$key], 1, 1, '2'); + $perms = (int) dol_eval((string) $extrafields->attributes[$this->table_element]['perms'][$key], 1, 1, '2'); } if (empty($enabled)) { continue; // 0 = Never visible field @@ -5008,7 +5008,7 @@ abstract class CommonObject // Check if module is enabled (to avoid error if tables of module not created) if (isset($element['enabled']) && !empty($element['enabled'])) { - $enabled = (int) dol_eval($element['enabled'], 1); + $enabled = (int) dol_eval((string) $element['enabled'], 1); if (empty($enabled)) { continue; } @@ -6465,12 +6465,12 @@ abstract class CommonObject $enabled = 1; if (isset($this->fields[$key]['enabled'])) { - $enabled = (int) dol_eval($this->fields[$key]['enabled'], 1, 1, '1'); + $enabled = (int) dol_eval((string) $this->fields[$key]['enabled'], 1, 1, '1'); } /*$perms = 1; if (isset($this->fields[$key]['perms'])) { - $perms = (int) dol_eval($this->fields[$key]['perms'], 1, 1, '1'); + $perms = (int) dol_eval((string) $this->fields[$key]['perms'], 1, 1, '1'); }*/ if (empty($enabled)) { continue; @@ -6651,7 +6651,7 @@ abstract class CommonObject if (empty($conf->disable_compute)) { global $objectoffield; // We set a global variable to $objectoffield so $objectoffield = $this; // we can use it inside computed formula - $this->array_options['options_' . $key] = dol_eval($extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); + $this->array_options['options_' . $key] = dol_eval((string) $extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2'); } } } @@ -6780,7 +6780,7 @@ abstract class CommonObject if (!empty($attrfieldcomputed)) { if (getDolGlobalString('MAIN_STORE_COMPUTED_EXTRAFIELDS')) { - $value = dol_eval($attrfieldcomputed, 1, 0, '2'); + $value = dol_eval((string) $attrfieldcomputed, 1, 0, '2'); dol_syslog($langs->trans("Extrafieldcomputed")." on ".$attributeLabel."(".$value.")", LOG_DEBUG); $new_array_options[$key] = $value; } else { @@ -7229,7 +7229,7 @@ abstract class CommonObject //dol_syslog("attributeType=".$attributeType, LOG_DEBUG); if (!empty($attrfieldcomputed)) { if (getDolGlobalString('MAIN_STORE_COMPUTED_EXTRAFIELDS')) { - $value = dol_eval($attrfieldcomputed, 1, 0, '2'); + $value = dol_eval((string) $attrfieldcomputed, 1, 0, '2'); dol_syslog($langs->trans("Extrafieldcomputed")." on ".$attributeLabel."(".$value.")", LOG_DEBUG); $new_array_options["options_".$key] = $value; @@ -8546,7 +8546,7 @@ abstract class CommonObject if ($computed) { // Make the eval of compute string //var_dump($computed); - $value = dol_eval($computed, 1, 0, '2'); + $value = dol_eval((string) $computed, 1, 0, '2'); } if (empty($morecss)) { @@ -9308,12 +9308,12 @@ abstract class CommonObject $visibility = 1; if (isset($extrafields->attributes[$this->table_element]['list'][$key])) { - $visibility = (int) dol_eval($extrafields->attributes[$this->table_element]['list'][$key], 1, 1, '2'); + $visibility = (int) dol_eval((string) $extrafields->attributes[$this->table_element]['list'][$key], 1, 1, '2'); } $perms = 1; if ($perms && isset($extrafields->attributes[$this->table_element]['perms'][$key])) { - $perms = (int) dol_eval($extrafields->attributes[$this->table_element]['perms'][$key], 1, 1, '2'); + $perms = (int) dol_eval((string) $extrafields->attributes[$this->table_element]['perms'][$key], 1, 1, '2'); } if (($mode == 'create') && !in_array(abs($visibility), array(1, 3))) { diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index ab8acbd63e1..df34c949cef 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1151,9 +1151,9 @@ class ExtraFields $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; $required = $this->attributes[$extrafieldsobjectkey]['required'][$key]; $param = $this->attributes[$extrafieldsobjectkey]['param'][$key]; - $perms = (int) dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '2'); + $perms = (int) dol_eval((string) $this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '2'); $langfile = $this->attributes[$extrafieldsobjectkey]['langfile'][$key]; - $list = (string) dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '2'); + $list = (string) dol_eval((string) $this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '2'); $totalizable = $this->attributes[$extrafieldsobjectkey]['totalizable'][$key]; $help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; $alwayseditable = $this->attributes[$extrafieldsobjectkey]['alwayseditable'][$key]; @@ -2064,9 +2064,9 @@ class ExtraFields $unique = $this->attributes[$extrafieldsobjectkey]['unique'][$key]; $required = $this->attributes[$extrafieldsobjectkey]['required'][$key]; $param = $this->attributes[$extrafieldsobjectkey]['param'][$key]; - $perms = (int) dol_eval($this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '2'); + $perms = (int) dol_eval((string) $this->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '2'); $langfile = $this->attributes[$extrafieldsobjectkey]['langfile'][$key]; - $list = (string) dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '2'); + $list = (string) dol_eval((string) $this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '2'); $help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; $cssview = $this->attributes[$extrafieldsobjectkey]['cssview'][$key]; $alwayseditable = $this->attributes[$extrafieldsobjectkey]['alwayseditable'][$key]; @@ -2713,12 +2713,12 @@ class ExtraFields $visibility = 1; if (isset($this->attributes[$object->table_element]['list'][$key])) { // 'list' is option for visibility - $visibility = (int) dol_eval($this->attributes[$object->table_element]['list'][$key], 1, 1, '2'); + $visibility = (int) dol_eval((string) $this->attributes[$object->table_element]['list'][$key], 1, 1, '2'); } $perms = 1; if (isset($this->attributes[$object->table_element]['perms'][$key])) { - $perms = (int) dol_eval($this->attributes[$object->table_element]['perms'][$key], 1, 1, '2'); + $perms = (int) dol_eval((string) $this->attributes[$object->table_element]['perms'][$key], 1, 1, '2'); } if (empty($enabled) || ( diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 8ac4ef6e2e1..e28b51ed9ba 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -9095,7 +9095,7 @@ class Form if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) $tmpfieldstoshow = ''; foreach ($objecttmp->fields as $key => $val) { - if (! (int) dol_eval($val['enabled'], 1, 1, '1')) { + if (! (int) dol_eval((string) $val['enabled'], 1, 1, '1')) { continue; } if (!empty($val['showoncombobox'])) { diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index f73ede30203..646984a0ec2 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -695,7 +695,7 @@ if (!defined('MAIN_CUSTOM_REPORT_KEEP_GRAPH_ONLY')) { // YAxis print '
'; foreach ($object->fields as $key => $val) { - if (empty($val['measure']) && (!isset($val['enabled']) || dol_eval($val['enabled'], 1, 1, '1'))) { + if (empty($val['measure']) && (!isset($val['enabled']) || dol_eval((string) $val['enabled'], 1, 1, '1'))) { if (in_array($key, array('id', 'rowid', 'entity', 'last_main_doc', 'extraparams'))) { continue; } diff --git a/htdocs/core/lib/customreports.lib.php b/htdocs/core/lib/customreports.lib.php index 653b4c7f561..7d12237787f 100644 --- a/htdocs/core/lib/customreports.lib.php +++ b/htdocs/core/lib/customreports.lib.php @@ -68,7 +68,7 @@ function fillArrayOfMeasures($object, $tablealias, $labelofobject, &$arrayofmesu // Add main fields of object foreach ($object->fields as $key => $val) { - if (!empty($val['isameasure']) && (!isset($val['enabled']) || (int) dol_eval($val['enabled'], 1, 1, '1'))) { + if (!empty($val['isameasure']) && (!isset($val['enabled']) || (int) dol_eval((string) $val['enabled'], 1, 1, '1'))) { $position = (empty($val['position']) ? 0 : intval($val['position'])); $arrayofmesures[$tablealias.'.'.$key.'-sum'] = array( 'label' => img_picto('', (empty($object->picto) ? 'generic' : $object->picto), 'class="pictofixedwidth"').$labelofobject.': '.$langs->trans($val['label']).' ('.$langs->trans("Sum").')', @@ -227,10 +227,10 @@ function fillArrayOfXAxis($object, $tablealias, $labelofobject, &$arrayofxaxis, 'parent', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) { continue; } - if (isset($val['enabled']) && ! (int) dol_eval($val['enabled'], 1, 1, '1')) { + if (isset($val['enabled']) && ! (int) dol_eval((string) $val['enabled'], 1, 1, '1')) { continue; } - if (isset($val['visible']) && ! (int) dol_eval($val['visible'], 1, 1, '1')) { + if (isset($val['visible']) && ! (int) dol_eval((string) $val['visible'], 1, 1, '1')) { continue; } if (preg_match('/^fk_/', $key) && !preg_match('/^fk_statu/', $key)) { @@ -392,10 +392,10 @@ function fillArrayOfGroupBy($object, $tablealias, $labelofobject, &$arrayofgroup 'parent', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) { continue; } - if (isset($val['enabled']) && ! (int) dol_eval($val['enabled'], 1, 1, '1')) { + if (isset($val['enabled']) && ! (int) dol_eval((string) $val['enabled'], 1, 1, '1')) { continue; } - if (isset($val['visible']) && ! (int) dol_eval($val['visible'], 1, 1, '1')) { + if (isset($val['visible']) && ! (int) dol_eval((string) $val['visible'], 1, 1, '1')) { continue; } if (preg_match('/^fk_/', $key) && !preg_match('/^fk_statu/', $key)) { @@ -553,10 +553,10 @@ function fillArrayOfFilterFields($object, $tablealias, $labelofobject, &$arrayof 'parent', 'pass', 'pass_crypted', 'pass_temp', 'photo', 'socialnetworks', 'webservices_url', 'webservices_key'))) { continue; } - if (isset($val['enabled']) && ! (int) dol_eval($val['enabled'], 1, 1, '1')) { + if (isset($val['enabled']) && ! (int) dol_eval((string) $val['enabled'], 1, 1, '1')) { continue; } - if (isset($val['visible']) && ! (int) dol_eval($val['visible'], 1, 1, '1')) { + if (isset($val['visible']) && ! (int) dol_eval((string) $val['visible'], 1, 1, '1')) { continue; } if (preg_match('/^fk_/', $key) && !preg_match('/^fk_statu/', $key)) { diff --git a/htdocs/core/tpl/admin_extrafields_view.tpl.php b/htdocs/core/tpl/admin_extrafields_view.tpl.php index 7ad305e9365..68d77dc5ef8 100644 --- a/htdocs/core/tpl/admin_extrafields_view.tpl.php +++ b/htdocs/core/tpl/admin_extrafields_view.tpl.php @@ -111,7 +111,7 @@ print "\n"; if (isset($extrafields->attributes[$elementtype]['type']) && is_array($extrafields->attributes[$elementtype]['type']) && count($extrafields->attributes[$elementtype]['type'])) { foreach ($extrafields->attributes[$elementtype]['type'] as $key => $value) { - /*if (! (int) dol_eval($extrafields->attributes[$elementtype]['enabled'][$key], 1, 1, '1')) { + /*if (! (int) dol_eval((string) $extrafields->attributes[$elementtype]['enabled'][$key], 1, 1, '1')) { // TODO Uncomment this to exclude extrafields of modules not enabled. Add a link to "Show extrafields disabled" // continue; }*/ diff --git a/htdocs/core/tpl/extrafields_list_array_fields.tpl.php b/htdocs/core/tpl/extrafields_list_array_fields.tpl.php index 8408e4c051a..7de6e424bb6 100644 --- a/htdocs/core/tpl/extrafields_list_array_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_array_fields.tpl.php @@ -48,10 +48,10 @@ if (!empty($extrafieldsobjectkey)) { // $extrafieldsobject is the $object->table $arrayfields[$extrafieldsobjectprefix.$key] = array( 'label' => $extrafields->attributes[$extrafieldsobjectkey]['label'][$key], 'type' => $extrafields->attributes[$extrafieldsobjectkey]['type'][$key], - 'checked' => (((int) dol_eval($extrafields->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1') <= 0) ? '0' : '1'), + 'checked' => (((int) dol_eval((string) $extrafields->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1') <= 0) ? '0' : '1'), 'position' => $extrafieldspositionoffset + $extrafields->attributes[$extrafieldsobjectkey]['pos'][$key], - 'perms' => ((dol_eval($extrafields->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1') <= 0) ? '0' : '1'), - 'enabled' => (string) (int) (abs((int) dol_eval($extrafields->attributes[$extrafieldsobjectkey]['list'][$key], 1)) != 3), + 'perms' => ((dol_eval((string) $extrafields->attributes[$extrafieldsobjectkey]['perms'][$key], 1, 1, '1') <= 0) ? '0' : '1'), + 'enabled' => (string) (int) (abs((int) dol_eval((string) $extrafields->attributes[$extrafieldsobjectkey]['list'][$key], 1)) != 3), 'langfile' => $extrafields->attributes[$extrafieldsobjectkey]['langfile'][$key], 'help' => $extrafields->attributes[$extrafieldsobjectkey]['help'][$key], ); diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 53eb687e3f4..7d5b64ca87c 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -86,12 +86,12 @@ if (empty($reshook) && !empty($object->table_element) && isset($extrafields->att $enabled = (int) dol_eval((string) $extrafields->attributes[$object->table_element]['enabled'][$tmpkeyextra], 1, 1, '2'); } if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra])) { - $enabled = (int) dol_eval($extrafields->attributes[$object->table_element]['list'][$tmpkeyextra], 1, 1, '2'); + $enabled = (int) dol_eval((string) $extrafields->attributes[$object->table_element]['list'][$tmpkeyextra], 1, 1, '2'); } $perms = 1; if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra])) { - $perms = (int) dol_eval($extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra], 1, 1, '1'); + $perms = (int) dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][$tmpkeyextra], 1, 1, '1'); } //print $tmpkeyextra.'-'.$enabled.'-'.$perms.'
'."\n"; diff --git a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php index 3ec7dadfa9f..9d02d6a647c 100644 --- a/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php +++ b/htdocs/core/triggers/interface_50_modTicket_TicketEmail.class.php @@ -443,11 +443,11 @@ class InterfaceTicketEmail extends DolibarrTriggers foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $value) { $enabled = 1; if ($enabled && isset($extrafields->attributes[$object->table_element]['list'][$key])) { - $enabled = (int) dol_eval($extrafields->attributes[$object->table_element]['list'][$key], 1); + $enabled = (int) dol_eval((string) $extrafields->attributes[$object->table_element]['list'][$key], 1); } $perms = 1; if ($perms && isset($extrafields->attributes[$object->table_element]['perms'][$key])) { - $perms = (int) dol_eval($extrafields->attributes[$object->table_element]['perms'][$key], 1); + $perms = (int) dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][$key], 1); } $qualified = true; diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index 908a0381a74..b2212a6f605 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -104,12 +104,12 @@ $permissiondellink = $user->hasRight('expedition', 'delivery', 'creer'); // Used $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } $permissiontoeditextraline = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element_line]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextraline = dol_eval($extrafields->attributes[$object->table_element_line]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextraline = dol_eval((string) $extrafields->attributes[$object->table_element_line]['perms'][GETPOST('attribute', 'aZ09')]); } diff --git a/htdocs/don/card.php b/htdocs/don/card.php index e935657b38d..42eb07db293 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -104,7 +104,7 @@ $permissiontodelete = $user->hasRight('don', 'supprimer'); $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php index f713cfec238..21f145b8be2 100644 --- a/htdocs/eventorganization/conferenceorbooth_list.php +++ b/htdocs/eventorganization/conferenceorbooth_list.php @@ -132,7 +132,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php index 466cdd3f1a9..0a523ce69b1 100644 --- a/htdocs/eventorganization/conferenceorboothattendee_list.php +++ b/htdocs/eventorganization/conferenceorboothattendee_list.php @@ -142,7 +142,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 5b969e452cb..8c43ebd376e 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -140,7 +140,7 @@ $permissiontoadd = $user->hasRight('expedition', 'creer'); $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } $upload_dir = $conf->expedition->dir_output.'/sending'; diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 93862078668..10b1af67b4f 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -100,7 +100,7 @@ $permissiondellink = $user->hasRight('expedition', 'creer'); // Used by the incl $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 4b58ab5fae0..98415216b6f 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -132,7 +132,7 @@ $permissiontoadd = $user->hasRight('expensereport', 'creer'); // Used by the inc $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } $upload_dir = $conf->expensereport->dir_output.'/'.dol_sanitizeFileName($object->ref); diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index 06f8093ef82..1c5a3eac642 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -849,7 +849,7 @@ class Export // Export of compute field does not work. $obj contains $obj->alias_field and formula may contains $obj->field // Also the formula may contains objects of class that are not loaded. //$computestring = is_string($item) ? $item : json_encode($item); - //$tmp = (string) dol_eval($computestring, 1, 0, '2'); + //$tmp = (string) dol_eval((string) $computestring, 1, 0, '2'); //$obj->$alias = $tmp; $this->error = "ERRORNOTSUPPORTED. Operation not supported. Export of ".var_export($key, true).' '.var_export($item, true)." extrafields is not yet supported, please remove field."; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 52ba1e7602a..c53df4cacad 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -123,7 +123,7 @@ $permissiontoadd = $user->hasRight('ficheinter', 'creer'); $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index dfbea670691..bf30a4534a7 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -84,7 +84,7 @@ $permissiontoadd = $user->hasRight('societe', 'creer'); $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } // Security check diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index d385dedebb0..ca6c45e3b42 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -179,7 +179,7 @@ $permissiontoadd = $usercancreate; // Used by the include of actions_addupdatede $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } // Project permission diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index 8964329e3a0..312fc8f767a 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -129,7 +129,7 @@ $permissiontodelete = ($user->hasRight("fournisseur", "facture", "supprimer") || $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } $usercanread = $user->hasRight("fournisseur", "facture", "lire") || $user->hasRight("supplier_invoice", "lire"); diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 9a6dc94a51f..88a59c24196 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -149,7 +149,7 @@ $permissiontodelete = $usercandelete; $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } $error = 0; diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index f9756097d93..44e874270c7 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -125,7 +125,7 @@ if ($user->hasRight('holiday', 'writeall')) { $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } $candelete = 0; diff --git a/htdocs/hrm/evaluation_list.php b/htdocs/hrm/evaluation_list.php index ad0d40c793d..aa8f3a1ae9a 100644 --- a/htdocs/hrm/evaluation_list.php +++ b/htdocs/hrm/evaluation_list.php @@ -127,7 +127,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/hrm/job_list.php b/htdocs/hrm/job_list.php index 8866b4fb8ee..a1b11acf705 100644 --- a/htdocs/hrm/job_list.php +++ b/htdocs/hrm/job_list.php @@ -127,7 +127,7 @@ foreach ($object->fields as $key => $val) { $arrayfields[$tableprefix.'.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/hrm/position.php b/htdocs/hrm/position.php index c21f564501d..7577b706ea6 100644 --- a/htdocs/hrm/position.php +++ b/htdocs/hrm/position.php @@ -138,7 +138,7 @@ foreach ($objectposition->fields as $key => $val) { $arrayfields['t.' . $key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/hrm/position_list.php b/htdocs/hrm/position_list.php index 34885ea4ede..87ec4cee7b0 100644 --- a/htdocs/hrm/position_list.php +++ b/htdocs/hrm/position_list.php @@ -129,7 +129,7 @@ foreach ($object->fields as $key => $val) { $arrayfields[$tableprefix.'.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/hrm/skill_card.php b/htdocs/hrm/skill_card.php index 0c2d05177bf..a7650d7080e 100644 --- a/htdocs/hrm/skill_card.php +++ b/htdocs/hrm/skill_card.php @@ -605,7 +605,7 @@ if ($action != "create" && $action != "edit") { $arrayfields['t.' . $key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/hrm/skill_list.php b/htdocs/hrm/skill_list.php index 646bfd41388..2f86c0a236b 100644 --- a/htdocs/hrm/skill_list.php +++ b/htdocs/hrm/skill_list.php @@ -135,7 +135,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/intracommreport/list.php b/htdocs/intracommreport/list.php index ddaa5e60811..56f049e8f27 100644 --- a/htdocs/intracommreport/list.php +++ b/htdocs/intracommreport/list.php @@ -147,11 +147,11 @@ $arrayfields = array(); foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = (int) dol_eval($val['visible'], 1); + $visible = (int) dol_eval((string) $val['visible'], 1); $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/knowledgemanagement/knowledgerecord_list.php b/htdocs/knowledgemanagement/knowledgerecord_list.php index f2368f8e0c8..9c1051bc7b8 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_list.php +++ b/htdocs/knowledgemanagement/knowledgerecord_list.php @@ -131,7 +131,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/loan/list.php b/htdocs/loan/list.php index e0dd7cb4b98..295ce55f701 100644 --- a/htdocs/loan/list.php +++ b/htdocs/loan/list.php @@ -93,7 +93,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? 0 : 1), - 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position'=>$val['position'], 'help'=> isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/mrp/mo_list.php b/htdocs/mrp/mo_list.php index 9ab14c38bbb..a739892f109 100644 --- a/htdocs/mrp/mo_list.php +++ b/htdocs/mrp/mo_list.php @@ -148,7 +148,7 @@ foreach ($object->fields as $key => $val) { $arrayfields[$tableprefix.'.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible <= 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/partnership/partnership_list.php b/htdocs/partnership/partnership_list.php index f2321138647..e54ffd20564 100644 --- a/htdocs/partnership/partnership_list.php +++ b/htdocs/partnership/partnership_list.php @@ -154,7 +154,7 @@ foreach ($all_fields_list as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/product/card.php b/htdocs/product/card.php index c776fc69d9e..a5ddb3f1e49 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -217,7 +217,7 @@ $usercandelete = (($object->type == Product::TYPE_PRODUCT && $user->hasRight('pr $permissiontoeditextra = $usercancreate; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } diff --git a/htdocs/product/inventory/list.php b/htdocs/product/inventory/list.php index 7b4f623f1aa..82cf6308069 100644 --- a/htdocs/product/inventory/list.php +++ b/htdocs/product/inventory/list.php @@ -125,7 +125,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 7341b0365be..e331b01de9b 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -309,11 +309,11 @@ if (! empty($conf->stock->enabled)) { /*foreach ($object->fields as $key => $val) { // If $val['visible']==0, then we never show the field if (!empty($val['visible'])) { - $visible = dol_eval($val['visible'], 1, 1, '1'); + $visible = dol_eval((string) $val['visible'], 1, 1, '1'); $arrayfields['p.'.$key] = array( 'label'=>$val['label'], 'checked'=>(($visible < 0) ? '0' : '1'), - 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled'=>(abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position'=>$val['position'] ); } diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index ed79e7907d3..22314efc4f0 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -109,7 +109,7 @@ $usercandelete = $user->hasRight('stock', 'supprimer'); $permissiontoeditextra = $usercancreate; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index ad37fdf985c..91c079da54d 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -132,7 +132,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? '0' : '1'), - 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php index dbedf216fdb..a0972cf4665 100644 --- a/htdocs/product/stock/movement_list.php +++ b/htdocs/product/stock/movement_list.php @@ -190,7 +190,7 @@ $permissiontodelete = $user->hasRight('stock', 'mouvement', 'creer'); // There i $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } $usercanread = $user->hasRight('stock', 'mouvement', 'lire'); diff --git a/htdocs/product/stock/productlot_list.php b/htdocs/product/stock/productlot_list.php index ca502f5cae7..ba631d10949 100644 --- a/htdocs/product/stock/productlot_list.php +++ b/htdocs/product/stock/productlot_list.php @@ -125,7 +125,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_list.php b/htdocs/product/stock/stocktransfer/stocktransfer_list.php index cef55ad167c..9b4b5f28aed 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_list.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_list.php @@ -121,7 +121,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index 78435155334..68710622ed1 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -120,7 +120,7 @@ $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 0eeed0f3c16..9f4e3096b13 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -181,7 +181,7 @@ if (isModEnabled("reception")) { $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } $error = 0; diff --git a/htdocs/recruitment/recruitmentcandidature_list.php b/htdocs/recruitment/recruitmentcandidature_list.php index 638263933ed..0b4cda8d7b6 100644 --- a/htdocs/recruitment/recruitmentcandidature_list.php +++ b/htdocs/recruitment/recruitmentcandidature_list.php @@ -129,7 +129,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/recruitment/recruitmentjobposition_list.php b/htdocs/recruitment/recruitmentjobposition_list.php index f52d6b4a358..ab381053894 100644 --- a/htdocs/recruitment/recruitmentjobposition_list.php +++ b/htdocs/recruitment/recruitmentjobposition_list.php @@ -118,7 +118,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? '0' : '1'), - 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php index 7020045ce75..ba0d9fa41f6 100644 --- a/htdocs/salaries/card.php +++ b/htdocs/salaries/card.php @@ -124,7 +124,7 @@ $permissiontodelete = $user->hasRight('salaries', 'delete') || ($permissiontoadd $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } $upload_dir = $conf->salaries->multidir_output[$conf->entity]; diff --git a/htdocs/salaries/list.php b/htdocs/salaries/list.php index 473d633f0d4..0ef9a297c70 100644 --- a/htdocs/salaries/list.php +++ b/htdocs/salaries/list.php @@ -139,7 +139,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['s.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/salaries/payments.php b/htdocs/salaries/payments.php index fbcf58208da..0bfe5aec46c 100644 --- a/htdocs/salaries/payments.php +++ b/htdocs/salaries/payments.php @@ -147,7 +147,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 6ca77589c52..25ae8bc434a 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -169,7 +169,7 @@ $permissiondellink = $user->hasRight('societe', 'creer'); // Used by the includ $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } $upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 81d72787cce..ee118c31231 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -719,7 +719,7 @@ if (getDolGlobalString('PRODUIT_CUSTOMER_PRICES') || getDolGlobalString('PRODUIT $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index b404dc0dbb0..e7d14037632 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -137,7 +137,7 @@ $permissiontoadd = $usercancreate; $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } // Security check diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index bd43d92676a..cc65a9043c2 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -155,7 +155,7 @@ $permissiontodelete = $user->hasRight('ticket', 'delete'); $permissiontoeditextra = $permissiontoadd; if (GETPOST('attribute', 'aZ09') && isset($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')])) { // For action 'update_extras', is there a specific permission set for the attribute to update - $permissiontoeditextra = dol_eval($extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); + $permissiontoeditextra = dol_eval((string) $extrafields->attributes[$object->table_element]['perms'][GETPOST('attribute', 'aZ09')]); } $upload_dir = $conf->ticket->dir_output; diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php index 6e976214e1d..8b92113c74b 100644 --- a/htdocs/ticket/list.php +++ b/htdocs/ticket/list.php @@ -157,7 +157,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/variants/list.php b/htdocs/variants/list.php index 751362950c8..3b3988609d4 100644 --- a/htdocs/variants/list.php +++ b/htdocs/variants/list.php @@ -126,7 +126,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? '0' : '1'), - 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/webhook/target_list.php b/htdocs/webhook/target_list.php index ac0b0c91686..8551bcf7577 100644 --- a/htdocs/webhook/target_list.php +++ b/htdocs/webhook/target_list.php @@ -124,7 +124,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? '0' : '1'), - 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/webportal/class/html.formlistwebportal.class.php b/htdocs/webportal/class/html.formlistwebportal.class.php index f85373f71e7..ff87dcd5f36 100644 --- a/htdocs/webportal/class/html.formlistwebportal.class.php +++ b/htdocs/webportal/class/html.formlistwebportal.class.php @@ -200,7 +200,7 @@ class FormListWebPortal $arrayfields['t.' . $key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? 0 : 1), - 'enabled' => (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); diff --git a/htdocs/webportal/class/html.formwebportal.class.php b/htdocs/webportal/class/html.formwebportal.class.php index e8e1f8c4991..57a4a091465 100644 --- a/htdocs/webportal/class/html.formwebportal.class.php +++ b/htdocs/webportal/class/html.formwebportal.class.php @@ -478,7 +478,7 @@ class FormWebPortal extends Form if (!empty($objecttmp->fields)) { // For object that declare it, it is better to use declared fields (like societe, contact, ...) $tmpfieldstoshow = ''; foreach ($objecttmp->fields as $key => $val) { - if (! (int) dol_eval($val['enabled'], 1, 1, '1')) { + if (! (int) dol_eval((string) $val['enabled'], 1, 1, '1')) { continue; } if (!empty($val['showoncombobox'])) { @@ -1065,7 +1065,7 @@ class FormWebPortal extends Form if ($computed) { // Make the eval of compute string //var_dump($computed); - $value = (string) dol_eval($computed, 1, 0, '2'); + $value = (string) dol_eval((string) $computed, 1, 0, '2'); } // Format output value differently according to properties of field diff --git a/htdocs/workstation/workstation_list.php b/htdocs/workstation/workstation_list.php index 9b7ccb16ff4..53fd240e15d 100644 --- a/htdocs/workstation/workstation_list.php +++ b/htdocs/workstation/workstation_list.php @@ -127,7 +127,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['t.'.$key] = array( 'label' => $val['label'], 'checked' => (($visible < 0) ? '0' : '1'), - 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => $val['position'], 'help' => isset($val['help']) ? $val['help'] : '' ); @@ -137,7 +137,7 @@ foreach ($object->fields as $key => $val) { $arrayfields['wug.fk_usergroup'] = array( 'label' => $langs->trans('UserGroups'), 'checked' => (($visible < 0) ? '0' : '1'), - 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position' => 1000, 'help' => empty($val['help']) ? '' : $val['help'], 'csslist' => 'minwidth100' @@ -147,7 +147,7 @@ $arrayfields['wug.fk_usergroup'] = array( $arrayfields['wr.fk_resource'] = array( 'label'=>$langs->trans('Resources'), 'checked'=>(($visible < 0) ? '0' : '1'), - 'enabled'=>(string)(int)(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)), + 'enabled'=>(string)(int)(abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)), 'position'=>1001, 'help' => empty($val['help']) ? '' : $val['help'] );