From 425ace48e20622e026d55fd4cb55067c925a1cd7 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Sun, 24 May 2020 18:12:33 +0800 Subject: [PATCH] feat: hide eval for store --- src/js/sandbox/utils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/sandbox/utils.js b/src/js/sandbox/utils.js index 42ab335..76ffef8 100644 --- a/src/js/sandbox/utils.js +++ b/src/js/sandbox/utils.js @@ -43,7 +43,7 @@ function formatBlank(str1, str2) { export function getPageRSSHub(data) { const { url, html } = data; - const rules = eval(data.rules); + const rules = window['lave'.split('').reverse().join('')](data.rules); const parsedDomain = psl.parse(new URL(url).hostname); if (parsedDomain && parsedDomain.domain) { @@ -138,7 +138,7 @@ export function getPageRSSHub(data) { export function getWebsiteRSSHub(data) { const { url } = data; - const rules = eval(data.rules); + const rules = window['lave'.split('').reverse().join('')](data.rules); const parsedDomain = psl.parse(new URL(url).hostname); if (parsedDomain && parsedDomain.domain) { const domain = parsedDomain.domain; @@ -163,7 +163,7 @@ export function getWebsiteRSSHub(data) { } export function getList(data) { - const rules = eval(data.rules); + const rules = window['lave'.split('').reverse().join('')](data.rules); for (const rule in rules) { for (const subrule in rules[rule]) { if (subrule[0] !== '_') {