Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Fix: Sanitize and bind host category listing dev-21.10.x #11805

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,16 @@
$aclFrom = ", $aclDbName.centreon_acl acl ";
$aclCond = " AND h.host_id = acl.host_id AND acl.group_id IN (" . $acl->getAccessGroupsString() . ") ";
}
$DBRESULT2 = $pearDB->query(
"SELECT h.host_id, h.host_activate " .
$hcStatement = $pearDB->prepare("SELECT h.host_id, h.host_activate " .
"FROM hostcategories_relation hcr, host h " . $aclFrom .
" WHERE hostcategories_hc_id = '" . $hc['hc_id'] . "'" .
" WHERE hostcategories_hc_id = :hcId" .
" AND h.host_id = hcr.host_host_id " . $aclCond .
" AND h.host_register = '1' "
);
" AND h.host_register = '1' ");
$hcStatement->bindValue(':hcId', (int) $hc['hc_id'], \PDO::PARAM_INT);
$hcStatement->execute();
$nbrhostActArr = array();
$nbrhostDeactArr = array();
while ($row = $DBRESULT2->fetch()) {
while ($row = $hcStatement->fetch()) {
if ($row['host_activate']) {
$nbrhostActArr[$row['host_id']] = true;
} else {
Expand Down