From 14f3aab8905e86e5b8fe22ced7fc44d996d0b1c2 Mon Sep 17 00:00:00 2001 From: rdwebdesign Date: Sat, 29 Jan 2022 02:47:13 -0300 Subject: [PATCH] Fix the wrong escaping on settings datatable Signed-off-by: rdwebdesign --- scripts/pi-hole/js/settings.js | 15 ++++++++++++++- settings.php | 3 --- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/pi-hole/js/settings.js b/scripts/pi-hole/js/settings.js index 3663822f8c..7506648459 100644 --- a/scripts/pi-hole/js/settings.js +++ b/scripts/pi-hole/js/settings.js @@ -268,9 +268,22 @@ $(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, type, row) { + // Show "unknown", when host is "*" + if (data == "*") { + return "unknown"; + } else { + return typeof data === "string" + ? data.replace(//g, ">").replace(/"/g, """) + : data; + } + }, + }, ], paging: true, order: [[2, "asc"]], diff --git a/settings.php b/settings.php index ec75d9e84d..ba933e0913 100644 --- a/settings.php +++ b/settings.php @@ -595,9 +595,6 @@ function convertseconds($argument) } $host = htmlentities($line[3]); - if ($host == "*") { - $host = "unknown"; - } $clid = $line[4]; if ($clid == "*") {