mirror of
https://github.com/prometheus/alertmanager
synced 2024-12-26 16:12:20 +00:00
Add HTML escaping to silence label input values.
This commit is contained in:
parent
5fabdee4b0
commit
6e09e98225
@ -12,12 +12,18 @@ function addSilenceLabel(label, value) {
|
||||
if (!value) {
|
||||
value = "";
|
||||
}
|
||||
$("#silence_filters_table").append(
|
||||
|
||||
row = $(
|
||||
'<tr>' +
|
||||
' <td><input class="input-large" name="silence_filter_label[]" type="text" placeholder="Label regex" value="' + label + '" required></td>' +
|
||||
' <td><input class="input-large" name="silence_filter_value[]" type="text" placeholder="Value regex" value="' + value + '" required></td>' +
|
||||
' <td><input class="input-large" name="silence_filter_label[]" type="text" placeholder="Label regex" required></td>' +
|
||||
' <td><input class="input-large" name="silence_filter_value[]" type="text" placeholder="Value regex" required></td>' +
|
||||
' <td><button type="button" class="btn del_label_button"><i class="icon-minus"></i></button></td>' +
|
||||
'</tr>');
|
||||
// Insert the values after creating the inputs to get automatic HTML escaping.
|
||||
row.find("input[name='silence_filter_label[]']").val(label);
|
||||
row.find("input[name='silence_filter_value[]']").val(value);
|
||||
|
||||
$("#silence_filters_table").append(row);
|
||||
bindDelLabel();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user