ChaseFlorell / jQuery.ProfanityFilter

filter out profane words on the client
https://chaseflorell.github.io/jQuery.ProfanityFilter/demo/
MIT License
110 stars 42 forks source link

Issue when parsing external swearWords file #30

Open rlevy12 opened 4 years ago

rlevy12 commented 4 years ago

Using the latest version of your demo code, plus the existing swearWords.json file, the browser produces an error message as follows:

Uncaught TypeError: badWords.concat(...).unique is not a function at HTMLDivElement. (jquery.profanityfilter.js:148) at Function.each (jquery.min.js:2) at init.each (jquery.min.js:2) at init.$.fn.profanityFilter (jquery.profanityfilter.js:122) at profanity-original-demo.html:146

From what I can tell, the issue lies with this line: var badWordsJSON = localStorage.getItem(localSwearsKey); Where the results come back as """" (two actual quotes inside of a quoted string). This causes the next line to fail: if (badWordsJSON === null) {

... because it really isn't null, it's a set of actual quotes. Changing the line to: if (badWordsJSON === null || badWordsJSON == "\"\"") { fixes the problem.

Thank you!

ChaseFlorell commented 4 years ago

hey Friend, it's been a very very long time since I've looked at this repo. I will absolutely accept a pull request if you know what the issue is and feel like fixing it.

rlevy12 commented 4 years ago

Hello Chase, thanks for your reply. I would love to create a pull request but I don't seem to be able to create a branch in this Github project in order to do so. I do have the fix committed in my local clone of this repo. Could you advise?

ChaseFlorell commented 4 years ago

You have to fork it to your own account. Make edits there, then pr

Get Outlook for Androidhttps://aka.ms/ghei36


From: rlevy12 notifications@github.com Sent: Wednesday, December 4, 2019 11:21:50 PM To: ChaseFlorell/jQuery.ProfanityFilter jQuery.ProfanityFilter@noreply.github.com Cc: Chase Florell chase@flomedia.ca; Comment comment@noreply.github.com Subject: Re: [ChaseFlorell/jQuery.ProfanityFilter] Issue when parsing external swearWords file (#30)

Hello Chase, thanks for your reply. I would love to create a pull request but I don't seem to be able to create a branch in this Github project in order to do so. I do have the fix committed in my local clone of this repo. Could you advise?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/ChaseFlorell/jQuery.ProfanityFilter/issues/30?email_source=notifications&email_token=AADTESXVWZ36WNIXN4NBW2DQXCFW5A5CNFSM4JURLP4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEF7QYBI#issuecomment-561974277, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AADTESWWQGU6IEAMUUQQG33QXCFW5ANCNFSM4JURLP4A.