Forum Discussion

jaread83's avatar
jaread83
Champion
8 years ago

swear filter wildcards

We have a few banned words that will replace content with [censored] after posting but we have found that a user can get around the swear filters by adding HTML to their post content between the letters of the banned word. This could be <em> tags, <span> etc etc.

Example:

<p>This is a ban<em>n</em><strong>e</strong>d word</p>

This is a banned word

I know it looks weird but imagine the word 'banned' was not allowed, it bypasses the swear filter. The user themselves were not swearing, they actually just altered our company name in a negative way which is against our forum rules. They had replaced part of the word with <em> tags and it got past our filter.

Is there a way to detect html within a banned word and ensure that it gets censored/replaced?