Profanity Filter - Not Working on Titles/Topic Subject Line

We’ve been having a problem recently with people posting profanity in the subject line/ topic title. It seems like the profanity filter should be working on that text also…

2개의 좋아요

So tempted to edit this title…

7개의 좋아요

I am having the same problem. I’m not trying to censor profanity but prevent this phone number this spammer keeps posting on our forum from being used. I am using the Akismet plugin but some amount of spam still gets through every night. Since the spammer has only used two different phone numbers in the entire time they have been spamming, I figured censored words would be an easy way to set them back. However, they just keep posting all of the information in the title of the topic and fill up the body with just random characters.

1개의 좋아요

You’re using the wrong approach – censored words is not to prevent spam. Try the official Akismet plugin.

2개의 좋아요

Regardless of the spam issues, should profanity be showing up in titles if it’s filtered in the actual posts?

@AmiAthena It shouldn’t. I had a brief look into the code base and this is because the censored words preprocessor is only applied to the body of the posts.

2개의 좋아요

PR submitted

https://github.com/discourse/discourse/pull/3692

2개의 좋아요

@zogstrip Lets close this? :smile:

3개의 좋아요

I just realized my fix was too simple. The censored words are still appearing in the title meta tag, links to the topic. I think the better way is to add a validation that disallow any censored words in the title. Any thoughts?

2개의 좋아요

Make sure that it only triggers when the title is changed, otherwise scheduled tasks that touch old topics containing disallowed words will raise an exception.

3개의 좋아요

Yes, we should do this, bearing in mind @riking’s caveat..

4개의 좋아요

Finally got around to adding a validation on the topic tittle

https://github.com/discourse/discourse/commit/3d21ccd4a56d91bd6ba095debbe7a658d6a19d62

6개의 좋아요