# Word censoring does not respect word boundaries in topic titles

**URL:** https://meta.discourse.org/t/word-censoring-does-not-respect-word-boundaries-in-topic-titles/65197
**Category:** Bug
**Created:** [2017 年 6 月 27 日午後 2:14 UTC](https://meta.discourse.org/t/word-censoring-does-not-respect-word-boundaries-in-topic-titles/65197 "2017-06-27T14:14:29Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Fredo](https://avatars.discourse-cdn.com/v4/letter/f/b4bc9f/32.png) [@Fredo](https://meta.discourse.org/u/Fredo)
#### Post date: [2017 年 6 月 27 日午後 2:14 UTC](https://meta.discourse.org/t/word-censoring-does-not-respect-word-boundaries-in-topic-titles/65197/1 "2017-06-27T14:14:29Z")

</div>

It seems the [censoring parser bug](https://meta.discourse.org/t/word-censor-butt-vs-button/20968/18) was not completely fixed. In post content, the word censorer replaces characters of censored words by ■, and for topic titles the censorer blocks posting until you change the title.

The bug caused legitimate words to be censored if they contain censored words, that means even if the word boundaries do not match. This was fixed for post content, but not for topic titles.

---

<div class="post-metadata">

### Author: ![Fredo](https://avatars.discourse-cdn.com/v4/letter/f/b4bc9f/32.png) [@Fredo](https://meta.discourse.org/u/Fredo)
#### Post date: [2017 年 6 月 27 日午後 2:15 UTC](https://meta.discourse.org/t/word-censoring-does-not-respect-word-boundaries-in-topic-titles/65197/2 "2017-06-27T14:15:14Z")

</div>

The censorer isn’t enabled in this forum, but you can try in a forum where it is.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2017 年 6 月 27 日午後 11:27 UTC](https://meta.discourse.org/t/word-censoring-does-not-respect-word-boundaries-in-topic-titles/65197/3 "2017-06-27T23:27:59Z")

</div>

@eviltrout can verify but if the censored word is

`arse`

and the matching word is

`parsed`

that should not match since there are no word boundaries on either side.

Oh wait – _you are referring to topic titles_, you massively buried the lede in your first post. I’ve edited topic title to reflect and Robin can validate the fix.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2017 年 6 月 28 日午後 5:14 UTC](https://meta.discourse.org/t/word-censoring-does-not-respect-word-boundaries-in-topic-titles/65197/4 "2017-06-28T17:14:25Z")

</div>

This should fix it:

[https://github.com/discourse/discourse/commit/b93edc9945daafed1c8c75c984d7d32f1658efa8](https://github.com/discourse/discourse/commit/b93edc9945daafed1c8c75c984d7d32f1658efa8)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2017 年 6 月 28 日午後 10:02 UTC](https://meta.discourse.org/t/word-censoring-does-not-respect-word-boundaries-in-topic-titles/65197/5 "2017-06-28T22:02:24Z")

</div>


