mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-15 22:11:36 +01:00
Clean code
This commit is contained in:
@@ -13628,7 +13628,7 @@ function dolForgeCriteriaCallback($matches)
|
|||||||
} else {
|
} else {
|
||||||
if (strtoupper($tmpescaped) == 'NULL') {
|
if (strtoupper($tmpescaped) == 'NULL') {
|
||||||
$tmpescaped = 'NULL';
|
$tmpescaped = 'NULL';
|
||||||
} elseif (ctype_digit((string) $tmpescaped)) {
|
} elseif (is_numeric((string) $tmpescaped)) {
|
||||||
$tmpescaped = (int) $tmpescaped;
|
$tmpescaped = (int) $tmpescaped;
|
||||||
} else {
|
} else {
|
||||||
$tmpescaped = (float) $tmpescaped;
|
$tmpescaped = (float) $tmpescaped;
|
||||||
|
|||||||
@@ -2585,10 +2585,10 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
|
|||||||
$sql .= " AND p.fk_statut = ".(int) $status;
|
$sql .= " AND p.fk_statut = ".(int) $status;
|
||||||
}
|
}
|
||||||
if (getDolGlobalString('PROJECT_LIMIT_YEAR_RANGE')) {
|
if (getDolGlobalString('PROJECT_LIMIT_YEAR_RANGE')) {
|
||||||
$project_year_filter = GETPOST("project_year_filter");
|
$project_year_filter = GETPOST("project_year_filter", 'alpha'); // '*' seems allowed
|
||||||
//Check if empty or invalid year. Wildcard ignores the sql check
|
//Check if empty or invalid year. Wildcard ignores the sql check
|
||||||
if ($project_year_filter != "*") {
|
if ($project_year_filter != "*") {
|
||||||
if (empty($project_year_filter) || !ctype_digit($project_year_filter)) {
|
if (empty($project_year_filter) || !is_numeric($project_year_filter)) {
|
||||||
$project_year_filter = date("Y");
|
$project_year_filter = date("Y");
|
||||||
}
|
}
|
||||||
$sql .= " AND (p.dateo IS NULL OR p.dateo <= ".$db->idate(dol_get_last_day($project_year_filter, 12, false)).")";
|
$sql .= " AND (p.dateo IS NULL OR p.dateo <= ".$db->idate(dol_get_last_day($project_year_filter, 12, false)).")";
|
||||||
|
|||||||
Reference in New Issue
Block a user