bugfix for method being added into word list
This commit is contained in:
parent
c317641dce
commit
03f39baf0d
@ -77,9 +77,10 @@ module.exports = class WordFilter extends FilterSetting {
|
||||
|
||||
} else if (['explicit', 'fuzzy', 'regex', 'whitelist'].includes(method)) {
|
||||
|
||||
const [first, ...rest] = args; // First arg should skip sanitisation
|
||||
if (method === 'regex') args = rest.map((arg) => Util.sanitiseRegex(arg, ['?', '\\', '(', ')', '|', '\\[', '\\]', '.', '-', '<']));
|
||||
const resolved = await resolver.resolveMethod([first, ...args], {
|
||||
// eslint-disable-next-line prefer-const
|
||||
let [first, ...rest] = args; // First arg should skip sanitisation
|
||||
if (method === 'regex') rest = rest.map((arg) => Util.sanitiseRegex(arg, ['?', '\\', '(', ')', '|', '\\[', '\\]', '.', '-', '<']));
|
||||
const resolved = await resolver.resolveMethod([first, ...rest], {
|
||||
existing: setting[method],
|
||||
allowedMethods: ['add', 'remove', 'set', 'reset', 'list']
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user