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 SNMP Traps groups configuration 21.10.x (#11807)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyahiaoui-ext authored Sep 21, 2022
1 parent 8209330 commit 8da2e2a
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,12 @@ function insertTrapGroup($ret = array())

$fields = array();
if (isset($ret['traps'])) {
$query = "INSERT INTO traps_group_relation (traps_group_id, traps_id) VALUES (:traps_group_id, :traps_id)";
$statement = $pearDB->prepare($query);
foreach ($ret['traps'] as $trap_id) {
$query = "INSERT INTO traps_group_relation (traps_group_id, traps_id) VALUES (" .
$pearDB->escape($trap_group_id['max_id']) . ",'" . $pearDB->escape($trap_id) . "')";
$pearDB->query($query);
$statement->bindValue(':traps_group_id', $trap_group_id['max_id'], \PDO::PARAM_INT);
$statement->bindValue(':traps_id', (int) $trap_id, \PDO::PARAM_INT);
$statement->execute();
}
}

Expand Down

0 comments on commit 8da2e2a

Please sign in to comment.