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

Commit

Permalink
FIX: Sanitize and bind Knowledge Base host listing (#11847)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyahiaoui-ext committed Sep 22, 2022
1 parent 627c093 commit 6952776
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions www/class/centreon-knowledge/procedures.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,15 @@ public function getMyHostMultipleTemplateModels($host_id = null)
"WHERE host_host_id = '" . $host_id . "' " .
"ORDER BY `order`"
);
$statement = $this->centreon_DB->prepare(
"SELECT host_name " .
"FROM host " .
"WHERE host_id = :host_id LIMIT 1"
);
while ($row = $dbResult->fetch()) {
$dbResult2 = $this->centreon_DB->query(
"SELECT host_name " .
"FROM host " .
"WHERE host_id = '" . $row['host_tpl_id'] . "' LIMIT 1"
);
$hTpl = $dbResult2->fetch();
$statement->bindValue(':host_id', $row['host_tpl_id'], \PDO::PARAM_INT);
$statement->execute();
$hTpl = $statement->fetch(\PDO::FETCH_ASSOC);
$tplArr[$row['host_tpl_id']] = html_entity_decode($hTpl["host_name"], ENT_QUOTES);
}
unset($row);
Expand Down

0 comments on commit 6952776

Please sign in to comment.