A closing round bracket breaks word censoring

I have recently been working on word censoring patterns to block some Finnish language expressions.

In the process, we discovered something I consider as a bug. I can reproduce it with censored words and censored patterns. Steps:

  1. Go to /admin/site_settings/category/posting.
  2. Scroll down and locate censored words and censored patterns.
  3. Censor something if you already haven’t.
  4. Open editor and write something nasty. You will see it censored like this: ■■■■■.
  5. Type a closing bracket ). Every censored word which precedes the bracket will show!

The closing bracket appears for instance in the common smiley :) which is converted to the respective emoji of course. So if you end your post with :), you can actually type anything you want without any censorship!

If it is not a real bug, feel free to merge these topics. :slight_smile:

1 Like

Yeah, I can reproduce. I added a nonsense word to my censored word lists. As one post:

:arrow_right:

But without the ( before the second gitorcz, both instances are not censored.

1 Like

Warning - dirty language follows. Are there any cencored words here?

Edit: Oops. At least not the most common curse words are cencored. I was trying to repro this issue here as this bug report is still valid in the 1.8 stable branch.

The censored words setting has been moved to a new UI “Watched Words” in 1.9. The censored patterns setting still exists, but the Watched Words lists can use * as a wildcards in the words. p*k for pork and punk.

5 Likes

Thanks for the update. The bug report is about going around the word filter by using a round bracket, like the basic smiley:

:)

Have these changes a positive impact on this glitch?

I believe that short of moderation, no 100% censoring is currently possible.

A while back I experimented with trying different ways to get by the filter to post working censored links. With my admitted limited attempts I was very satisfied with the results - in terms of breaking censored links

In terms of words there are at least several ways to convey words or their meaning despite the censored word filtering. For example, I can type WHAT is this !#^*! and many would substitute the word themselves.

Anyway, AFAIK, the code of interest is
https://github.com/discourse/discourse/blob/master/app/assets/javascripts/pretty-text/censored-words.js.es6

1 Like