This project is read-only.

Bad words / profanity in the Posts

Topics: ASP.NET 2.0, Business Logic Layer
Sep 23, 2013 at 10:43 AM
Edited Sep 23, 2013 at 10:43 AM
Have seen some posts on the Bad words in the Comments but a bit stuck on how to do this for the "Post" section... Can this be changed before the admin gets to moderate it... Have seen that it is possibly for the Comments section - swaps words for another word (is case sensitive) but I am looking at the Post section.... Do not mind if a different characters or words... Any help would be great... thanks
Sep 23, 2013 at 8:01 PM
Based on what I can tell, there doesn't seem to by anything I can find that can just plug into BE. However if you're a bit programming savvy you can probably ladle in your own using info from here:
Sep 25, 2013 at 8:48 AM
Hi CD_WTM, thanks for the information... Just got it working as a json - replacement word script - that on the screen any rude words are ******, having trouble adding a .json file to it...

in your theme - site.master (works)
<!-- In the Header -->
<script src="jquery.profanityfilter.js" type="text/javascript"></script>
<script src="../../../../themes/Standard/include/jquery.profanityfilter.js" type="text/javascript"></script>

<!-- Bottom of the Body -->
    customSwears: ['rude', 'another', 'word', 'etc'],

jQuery taken from

Having trouble with this one... Where to add the externalSwears... on BlogEngine - using latest version...?
<!-- Bottom of the Body -->
                customSwears: ['ass'],
                externalSwears: '/swearWords.json'
Sep 25, 2013 at 11:31 PM
It looks like you're well on your way; I'm unfortunately not too savvy with JSON never having had a need for it (I'm more of an infrastructure guy) so I don't think I can help you with that. One thing I'd point out is that (depending on how it's implemented) a client side solution could still be defeated by someone who really really wants to swear via various means, like disabling javascript, messing around with fiddler, etc. The alternative is to filter on server side after the page has been posted.
Sep 26, 2013 at 10:22 AM
Can't argue with what CD_WTM is saying, but aside from that, what you have should be working.

Out of curiosity I downloaded that plugin, dropped the jquery.profanity file into Scripts/Auto/ folder and added the script to site.master just before the closing body tag. The swearWords.json file to the blog root.

Tested on a primary and sub blog and both work as expected.

Since you are saying that customSwears works and you have the json file in the blog root, the only thing I can think of is that your swearWords.json file might not be properly formatted, should look something like this