Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lib doesn't clean words with characters like * - _ even words with space between characters #106

Open
Lapro15 opened this issue Apr 8, 2021 · 1 comment

Comments

@Lapro15
Copy link

Lapro15 commented Apr 8, 2021

I'm running over an issue, here is my function (with the word ash*le for exemple):

const applyWordFiltered = text => {
    const badWordsFilter = new Filter({ emptyList: true })
    badWordsFilter.addWords(...["ash*le"])

    return {
      isProfane: badWordsFilter.isProfane(text),
      cleanedValue: badWordsFilter.clean(text),
    }
  }

filteredWord = applyWordFiltered(event.target.value)

I received

filteredWord= {
 isProfane: true,
 cleanedValue: 'ash*le',
}

and I'm supposed to receive

filteredWord= {
 isProfane: true,
 cleanedValue: '******',
}

even "f u c k" isn't clean, badWordsFilter.clean("f u c k") >> "f u c k" instead of "*******"

@Lapro15 Lapro15 changed the title lib doesn't clean words with characters like * - _ Lib doesn't clean words with characters like * - _ even words with space between characters Apr 16, 2021
@djminkus
Copy link

It's a definite issue that simply adding spaces lets you bypass the filter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants