From eba56942a1c34f144248b50d6d4a8173750434bf Mon Sep 17 00:00:00 2001 From: zefie Date: Wed, 30 Nov 2022 13:41:52 -0500 Subject: [PATCH] fix debugging --- zefie_wtvp_minisrv/includes/classes/WTVShared.js | 8 ++++---- zefie_wtvp_minisrv/includes/config.json | 5 +++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/zefie_wtvp_minisrv/includes/classes/WTVShared.js b/zefie_wtvp_minisrv/includes/classes/WTVShared.js index dfbcf803..179fe737 100644 --- a/zefie_wtvp_minisrv/includes/classes/WTVShared.js +++ b/zefie_wtvp_minisrv/includes/classes/WTVShared.js @@ -247,10 +247,10 @@ class WTVShared { Object.keys(this.minisrv_config.services).forEach((k) => { var flag = parseInt(this.minisrv_config.services[k].flags, 16); if (flag === 4 || flag === 7) { - allowedProtocols.push(k); + if (!allowedProtocols.includes(k)) allowedProtocols.push(k); } }); - console.log(allowedProtocols); + self.debug("sanitizeSignature", "allowed protocols:", allowedProtocols); const clean = this.sanitizeHtml(string, { allowedTags: ['a', 'audioscope', 'b', 'bgsound', 'big', 'blackface', 'blockquote', 'bq', 'br', 'caption', 'center', 'cite', 'c', 'dd', 'dfn', 'div', 'dl', 'dt', 'fn', 'font', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'html', 'i', 'img', 'label', 'li', 'link', 'listing', 'em', 'marquee', 'nobr', 'note', 'ol', 'p', 'plaintext', 'pre', 's', 'samp', 'small', 'span', 'strike', 'strong', 'sub', 'sup', 'tbody', 'table', 'td', 'th', 'tr', 'tt', 'u', 'ul'], @@ -269,7 +269,7 @@ class WTVShared { var allowed = true; Object.keys(frame.attribs).forEach((k) => { if (k == "href" || k == "background" || k == "src") { - var allowed = false; + allowed = false; var value = frame.attribs[k]; Object.keys(allowedProtocols).forEach((j) => { if (value.startsWith(allowedProtocols[j])) { @@ -279,7 +279,7 @@ class WTVShared { }) } }); - console.log(frame, allowed); + self.debug("sanitizeSignature", "filter result:", frame, "allowed:", allowed); return !allowed; }, allowVulnerableTags: false, diff --git a/zefie_wtvp_minisrv/includes/config.json b/zefie_wtvp_minisrv/includes/config.json index 30a1df24..b178cc8d 100644 --- a/zefie_wtvp_minisrv/includes/config.json +++ b/zefie_wtvp_minisrv/includes/config.json @@ -163,7 +163,7 @@ // wtv-1800 "port": 1615, "connections": 1, - "flags": "0x00000004", + "flags": "0x00000001", "send_tellyscripts": true // Best left untouched }, "wtv-flashrom": { @@ -190,7 +190,8 @@ "wtv-music": { // wtv-music "port": 1656, - "connections": 3 + "connections": 3, + "flags": "0x00000004" }, "wtv-cookie": { // wtv-cookie (used for http(s) cookies)