update agent custom fields

This commit is contained in:
marcos 2021-09-30 14:34:58 +02:00
parent d54af52baf
commit d0f08be953
2 changed files with 3 additions and 3 deletions

View File

@ -3439,7 +3439,7 @@ sub pandora_select_combo_custom_field ($$) {
sub pandora_update_agent_custom_field ($$$$) {
my ($dbh, $token, $field, $id_agent) = @_;
my $result = undef;
$result = db_update ($dbh, 'UPDATE tagent_custom_data SET description = ? WHERE id_field = ? AND id_agent = ?', $token, $field, $id_agent);
$result = db_update ($dbh, 'UPDATE tagent_custom_data SET description = ? WHERE id_field = ? AND id_agent = ?', safe_input($token), $field, $id_agent);
return $result;
}

View File

@ -3078,7 +3078,7 @@ sub cli_agent_update_custom_fields() {
my @fields = split(',',$exist_option);
foreach my $combo (@fields) {
if($combo eq $new_value) {
if($combo eq safe_input($new_value)) {
$found = 1;
}
}
@ -3090,7 +3090,7 @@ sub cli_agent_update_custom_fields() {
print_log "\n[INFO] Updating field '$field' in agent with ID '$id_agent'\n\n";
my $result = pandora_update_agent_custom_field ($dbh, $new_value, $custom_field, $id_agent);
my $result = pandora_update_agent_custom_field ($dbh, $new_value, $custom_field, $id_agent);
if($result == "0E0"){
print_log "[ERROR] Error updating field '$field'\n\n";