FIX SQL Injection CWE-89
This commit is contained in:
parent
1009a629d9
commit
1623fea618
@ -72,7 +72,7 @@ $search_user = GETPOST('search_user','int');
|
|||||||
$search_amount_ht = GETPOST('search_amount_ht','alpha');
|
$search_amount_ht = GETPOST('search_amount_ht','alpha');
|
||||||
$search_amount_vat = GETPOST('search_amount_vat','alpha');
|
$search_amount_vat = GETPOST('search_amount_vat','alpha');
|
||||||
$search_amount_ttc = GETPOST('search_amount_ttc','alpha');
|
$search_amount_ttc = GETPOST('search_amount_ttc','alpha');
|
||||||
$search_status = (GETPOST('search_status','alpha')!=''?GETPOST('search_status','alpha'):GETPOST('statut','alpha'));
|
$search_status = (GETPOST('search_status','intcomma')!=''?GETPOST('search_status','intcomma'):GETPOST('statut','intcomma'));
|
||||||
$month_start = GETPOST("month_start","int");
|
$month_start = GETPOST("month_start","int");
|
||||||
$year_start = GETPOST("year_start","int");
|
$year_start = GETPOST("year_start","int");
|
||||||
$month_end = GETPOST("month_end","int");
|
$month_end = GETPOST("month_end","int");
|
||||||
@ -305,11 +305,7 @@ if ($search_amount_ttc != '') $sql.= natural_search('d.total_ttc', $search_amoun
|
|||||||
// User
|
// User
|
||||||
if ($search_user != '' && $search_user >= 0) $sql.= " AND u.rowid = '".$db->escape($search_user)."'";
|
if ($search_user != '' && $search_user >= 0) $sql.= " AND u.rowid = '".$db->escape($search_user)."'";
|
||||||
// Status
|
// Status
|
||||||
if ($search_status != '' && $search_status >= 0)
|
if ($search_status != '' && $search_status >= 0) $sql.=" AND d.fk_statut IN (".$db->escape($search_status).")";
|
||||||
{
|
|
||||||
if (strstr($search_status, ',')) $sql.=" AND d.fk_statut IN (".$db->escape($search_status).")";
|
|
||||||
else $sql.=" AND d.fk_statut = ".$search_status;
|
|
||||||
}
|
|
||||||
// RESTRICT RIGHTS
|
// RESTRICT RIGHTS
|
||||||
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)
|
if (empty($user->rights->expensereport->readall) && empty($user->rights->expensereport->lire_tous)
|
||||||
&& (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance)))
|
&& (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance)))
|
||||||
|
|||||||
@ -85,7 +85,7 @@ if (! $sortorder) $sortorder="DESC";
|
|||||||
|
|
||||||
|
|
||||||
$sall = trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
$sall = trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
|
||||||
$search_ref = GETPOST('search_ref','alpha');
|
$search_ref = GETPOST('search_ref','alphanohtml');
|
||||||
$search_day_create = GETPOST('search_day_create','int');
|
$search_day_create = GETPOST('search_day_create','int');
|
||||||
$search_month_create = GETPOST('search_month_create','int');
|
$search_month_create = GETPOST('search_month_create','int');
|
||||||
$search_year_create = GETPOST('search_year_create','int');
|
$search_year_create = GETPOST('search_year_create','int');
|
||||||
@ -185,7 +185,7 @@ $order = $db->order($sortfield,$sortorder).$db->plimit($limit + 1, $offset);
|
|||||||
// Ref
|
// Ref
|
||||||
if(!empty($search_ref))
|
if(!empty($search_ref))
|
||||||
{
|
{
|
||||||
$filter.= " AND cp.rowid = ".$db->escape($search_ref);
|
$filter.= " AND cp.rowid = ".(int) $db->escape($search_ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start date
|
// Start date
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user