XF 2.2 Bounce post on Word Censor hit

chris p


We are putting in xenForo from a highly modified phpbb2. I didn't think about this until I went to help out getting the moderator set up to manage the forums. In the long distant past, I had modified our phpbb2 so censored words would never be replaced, the post would just be dropped with a descriptive error message describing the unacceptable behavior and reminding them of the ToS.

Similar to the original phpbb2, the word censors would appear to only replace words, when normally, those words would be surrounded by other verbiage and attitudes that are inappropriate in our ToS. By allowing the post to go in, it increases labor required by moderation since the post will have to be deleted. This is fairly easy to detect in our case because we don't permit swearing or obfuscation of swearing, and the false positives are low enough to be acceptable. To allow the word caught in the censor to post through, in our case, is condoning it's use because it still conveys the sentiment to viewers of the post. We would like to have the post dropped before it gets in and has to be removed (and potentially ban the individual). Often the banning becomes unnecessary since people tend to clean up with they say to get the post through, which further reduces administrative labor.

Will I need to build an addon to support this or does xenForo have the capability of rejecting the post when people hit a word censor? Is there another capability in the Admin CP to support this aside from Word Censors?

Thank you in advance.
In case someone runs into this. I found I could force the censor check prior to allowing the post into the database with the call below. This would then be tested for a present unique value used as censor replacement word. Similar was required for the xf_post.message.

$censoredTitle = (\XF::app()->stringFormatter()->censorText($thread->title));
Thank you very much. That would have saved some effort but I finished mine and it hopefully will survive upgrades. I used the class extension of XF\Service\Thread\Creator and XF\Service\Thread\Replier for where I placed the censor check and by using the unique replacement word, regular obfuscation of the word will still work if no replacement word was provided. If the unique word was found, it throws a message to the user stopping the post. I put this in my existing addon just to save effort since no one else will likely ever use my addon.
Top Bottom