jQuery.ProfanityFilter icon indicating copy to clipboard operation
jQuery.ProfanityFilter copied to clipboard

ASCII Character code not working

Open delacruzjames opened this issue 10 years ago • 3 comments

[ ["@$$f@ce"], ["@$$h0le"], ["@$$he@d"], ["@$$hole"], ["@$$hols"], ]

delacruzjames avatar Mar 13 '14 07:03 delacruzjames

+1

MonrealRyan avatar Jul 21 '15 02:07 MonrealRyan

Got a fix for this.

Add the following function:

function escapeRegExp(str) {
    return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
}

Find the regex that is doing the string replace, I used the non-minified version and replace it with the following (around line 161):

re = new RegExp('\\b' + escapeRegExp(badWords[i]) + '\\b', 'gi');

2gen avatar Nov 03 '15 18:11 2gen

@2gen would you drop a PR on this? I'd be happy to accept.

ChaseFlorell avatar Jan 18 '16 18:01 ChaseFlorell