Skip to content

Commit bfa05ce

Browse files
committed
fix(isProfaneLike): fix case sensitive checks within list
pass case insensitive flag to regexp constructor #24
1 parent cd40179 commit bfa05ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/badwords.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var Filter = (function() {
4141
Filter.prototype.isProfaneLike = function profaneLike(word) {
4242
return !!~this.exclude.indexOf(word) ? false : !!~this.list.indexOf(word) || this.list
4343
.map(function(w) {
44-
return new RegExp(w.replace(/(\W)/g, '\\$1'));
44+
return new RegExp(w.replace(/(\W)/g, '\\$1'), 'gi');
4545
}, this)
4646
.reduce(function(outcome, wordExp) {
4747
if (wordExp.test(word)) {

0 commit comments

Comments
 (0)