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)) {
|
} else if (['explicit', 'fuzzy', 'regex', 'whitelist'].includes(method)) {
|
||||||
|
|
||||||
const [first, ...rest] = args; // First arg should skip sanitisation
|
// eslint-disable-next-line prefer-const
|
||||||
if (method === 'regex') args = rest.map((arg) => Util.sanitiseRegex(arg, ['?', '\\', '(', ')', '|', '\\[', '\\]', '.', '-', '<']));
|
let [first, ...rest] = args; // First arg should skip sanitisation
|
||||||
const resolved = await resolver.resolveMethod([first, ...args], {
|
if (method === 'regex') rest = rest.map((arg) => Util.sanitiseRegex(arg, ['?', '\\', '(', ')', '|', '\\[', '\\]', '.', '-', '<']));
|
||||||
|
const resolved = await resolver.resolveMethod([first, ...rest], {
|
||||||
existing: setting[method],
|
existing: setting[method],
|
||||||
allowedMethods: ['add', 'remove', 'set', 'reset', 'list']
|
allowedMethods: ['add', 'remove', 'set', 'reset', 'list']
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user