Clean code

This commit is contained in:
Laurent Destailleur
2021-04-26 19:12:23 +02:00
parent 14baec95dc
commit d138e7410b
37 changed files with 208 additions and 63 deletions

View File

@@ -413,7 +413,7 @@ class WebsitePage extends CommonObject
if (count($filter) > 0) {
foreach ($filter as $key => $value) {
if ($key == 't.rowid' || $key == 't.fk_website' || $key == 'status') {
$sqlwhere[] = $key.' = '.$value;
$sqlwhere[] = $key.' = '.((int) $value);
} elseif ($key == 'type_container') {
$sqlwhere[] = $key." = '".$this->db->escape($value)."'";
} elseif ($key == 'lang' || $key == 't.lang') {
@@ -515,7 +515,7 @@ class WebsitePage extends CommonObject
if (count($filter) > 0) {
foreach ($filter as $key => $value) {
if ($key == 't.rowid' || $key == 't.fk_website' || $key == 'status') {
$sqlwhere[] = $key.' = '.$value;
$sqlwhere[] = $key.' = '.((int) $value);
} elseif ($key == 'type_container') {
$sqlwhere[] = $key." = '".$this->db->escape($value)."'";
} elseif ($key == 'lang' || $key == 't.lang') {
@@ -528,7 +528,7 @@ class WebsitePage extends CommonObject
}
$listoflang[] = "'".$this->db->escape(substr(str_replace("'", '', $tmpvalue), 0, 2))."'";
}
$stringtouse = $key." IN (".$this->db->sanitize(join(',', $listoflang)).")";
$stringtouse = $key." IN (".$this->db->sanitize(join(',', $listoflang), 1).")";
if ($foundnull) {
$stringtouse = '('.$stringtouse.' OR '.$key.' IS NULL)';
}

View File

@@ -281,7 +281,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtmlref .= '</div>';
if ($socid > 0) {
$object->next_prev_filter = 'te.fk_soc = '.$socid;
$object->next_prev_filter = 'te.fk_soc = '.((int) $socid);
}
dol_banner_tab($object, 'id', $linkback, 1, 'rowid', 'rowid', $morehtmlref);