From f486935eb8be61cf39aabed911a9c89334a71e86 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 17 Dec 2019 15:55:02 +0200 Subject: [PATCH] Use `text()` for the token We don't need any HTML. Signed-off-by: XhmikosR --- scripts/pi-hole/js/auditlog.js | 2 +- scripts/pi-hole/js/db_queries.js | 2 +- scripts/pi-hole/js/debug.js | 2 +- scripts/pi-hole/js/footer.js | 2 +- scripts/pi-hole/js/list.js | 2 +- scripts/pi-hole/js/queries.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/pi-hole/js/auditlog.js b/scripts/pi-hole/js/auditlog.js index 7c92a58d..41f8bb65 100644 --- a/scripts/pi-hole/js/auditlog.js +++ b/scripts/pi-hole/js/auditlog.js @@ -73,7 +73,7 @@ function updateTopLists() { function add(domain,list) { - var token = $("#token").html(); + var token = $("#token").text(); $.ajax({ url: "scripts/pi-hole/php/add.php", method: "post", diff --git a/scripts/pi-hole/js/db_queries.js b/scripts/pi-hole/js/db_queries.js index 76ec1f93..20f19955 100644 --- a/scripts/pi-hole/js/db_queries.js +++ b/scripts/pi-hole/js/db_queries.js @@ -70,7 +70,7 @@ function escapeRegex(text) { } function add(domain,list) { - var token = $("#token").html(); + var token = $("#token").text(); var alInfo = $("#alInfo"); var alList = $("#alList"); var alDomain = $("#alDomain"); diff --git a/scripts/pi-hole/js/debug.js b/scripts/pi-hole/js/debug.js index 4f5daf6c..787e5e9a 100644 --- a/scripts/pi-hole/js/debug.js +++ b/scripts/pi-hole/js/debug.js @@ -29,7 +29,7 @@ function eventsource() { var ta = $("#output"); var upload = $( "#upload" ); var checked = ""; - var token = encodeURIComponent($("#token").html()); + var token = encodeURIComponent($("#token").text()); if(upload.prop("checked")) { diff --git a/scripts/pi-hole/js/footer.js b/scripts/pi-hole/js/footer.js index ccdf67a8..068d610f 100644 --- a/scripts/pi-hole/js/footer.js +++ b/scripts/pi-hole/js/footer.js @@ -58,7 +58,7 @@ function countDown(){ function piholeChange(action, duration) { - var token = encodeURIComponent($("#token").html()); + var token = encodeURIComponent($("#token").text()); var enaT = $("#enableTimer"); var btnStatus; diff --git a/scripts/pi-hole/js/list.js b/scripts/pi-hole/js/list.js index d28350da..8655bd96 100644 --- a/scripts/pi-hole/js/list.js +++ b/scripts/pi-hole/js/list.js @@ -8,7 +8,7 @@ $.ajaxSetup({cache: false}); // Get PHP info -var token = $("#token").html(); +var token = $("#token").text(); var listType = $("#list-type").html(); var fullName = listType === "white" ? "Whitelist" : "Blacklist"; diff --git a/scripts/pi-hole/js/queries.js b/scripts/pi-hole/js/queries.js index 5ab26bd1..607cd680 100644 --- a/scripts/pi-hole/js/queries.js +++ b/scripts/pi-hole/js/queries.js @@ -21,7 +21,7 @@ function refreshData() { } function add(domain,list) { - var token = $("#token").html(); + var token = $("#token").text(); var alertModal = $("#alertModal"); var alProcessing = alertModal.find(".alProcessing"); var alSuccess = alertModal.find(".alSuccess");