From 2b862b2d98b3aca71696ae91f1704355329c55c3 Mon Sep 17 00:00:00 2001 From: "weakmap@gmail.com" Date: Sat, 14 Jun 2025 19:25:52 +0200 Subject: [PATCH] fixing blacklist --- lib/utils.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/utils.js b/lib/utils.js index 4f8527b..c8a6449 100755 --- a/lib/utils.js +++ b/lib/utils.js @@ -9,12 +9,9 @@ function inDevMode(){ } function isOneOf(word, arr) { - if (arr == null || arr.length === 0) { - return false; - } - const expression = String.raw`\b(${arr.join('|')})\b`; - const blacklist = new RegExp(expression, 'ig'); - return blacklist.test(word); + if (!arr || arr.length === 0 || word == null) return false; + const lowerWord = word.toLowerCase(); + return arr.some(item => lowerWord.indexOf(item.toLowerCase()) !== -1); } function nullOrEmpty(val) {