Fix the wrong escaping on settings datatable (#2100)

* Fix the wrong escaping on settings datatable

Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>

* Using utils escapeHtml function

Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>

* Fix prettier

Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>
This commit is contained in:
RD WebDesign
2022-01-30 10:46:47 -03:00
committed by GitHub
parent a302e9fedb
commit bf82c47e98
2 changed files with 15 additions and 4 deletions

View File

@@ -268,9 +268,23 @@ $(function () {
columnDefs: [
{ bSortable: false, orderable: false, targets: -1 },
{
targets: [0, 1, 2],
targets: [0, 1],
render: $.fn.dataTable.render.text(),
},
{
targets: 2,
render: function (data) {
// Show "unknown", when host is "*"
var str;
if (data === "*") {
str = "<i>unknown</i>";
} else {
str = typeof data === "string" ? utils.escapeHtml(data) : data;
}
return str;
},
},
],
paging: true,
order: [[2, "asc"]],