From 027cf37940613129b7df4fb916faf34e1d8c2e63 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 31 Mar 2024 20:47:57 +0200 Subject: [PATCH] Fix GETPOSTINT --- htdocs/holiday/list.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php index a4eaae03a8579..c567bad831d4c 100644 --- a/htdocs/holiday/list.php +++ b/htdocs/holiday/list.php @@ -53,7 +53,6 @@ $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'holidaylist'; // To manage different context of search $mode = GETPOST('mode', 'alpha'); // for switch mode view result - $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') @@ -83,7 +82,7 @@ $sortfield = "cp.ref"; } -$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); +$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml')); $search_ref = GETPOST('search_ref', 'alphanohtml'); $search_day_create = GETPOST('search_day_create', 'int'); $search_month_create = GETPOST('search_month_create', 'int'); @@ -94,10 +93,10 @@ $search_day_end = GETPOST('search_day_end', 'int'); $search_month_end = GETPOST('search_month_end', 'int'); $search_year_end = GETPOST('search_year_end', 'int'); -$search_employee = GETPOSTINT('search_employee'); -$search_valideur = GETPOSTINT('search_valideur'); +$search_employee = GETPOST('search_employee', 'intcomma'); +$search_valideur = GETPOST('search_valideur', 'intcomma'); $search_status = GETPOST('search_status', 'intcomma'); -$search_type = GETPOSTINT('search_type'); +$search_type = GETPOST('search_type', 'intcomma'); // Initialize technical objects $object = new Holiday($db); @@ -322,8 +321,8 @@ $sql .= " WHERE cp.entity IN (".getEntity('holiday').")"; $sql .= " AND cp.fk_user = uu.rowid AND cp.fk_validator = ua.rowid "; // Hack pour la recherche sur le tableau // Search all -if (!empty($sall)) { - $sql .= natural_search(array_keys($fieldstosearchall), $sall); +if (!empty($search_all)) { + $sql .= natural_search(array_keys($fieldstosearchall), $search_all); } // Ref if (!empty($search_ref)) { @@ -552,14 +551,14 @@ $trackid = 'leav'.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; -if ($sall) { +if ($search_all) { $setupstring = ''; foreach ($fieldstosearchall as $key => $val) { $fieldstosearchall[$key] = $langs->trans($val); $setupstring .= $key."=".$val.";"; } print ''."\n"; - print '
'.$langs->trans("FilterOnInto", $sall).implode(', ', $fieldstosearchall).'
'; + print '
'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'
'; } $moreforfilter = '';