[Logo] JForum - Powering Communities
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Top Downloads] Top Downloads   [Members] Member Listing   [Groups] Back to home page 
[Moderation Log] Moderation Log   [Register] Register /  [Login] Login 


JForum 2.5.0 released, download it from here.
Bad / Censored word list  RSS feed
Forum Index » User Forum
Author Message
al


Joined: 2011/12/7
Messages: 1
Offline

I was wondering if anyone has incorporated "bad word" functionality.
Ie. A kind of regex replacement ie. someone posts "sh#t" and the offending term is automatically
removed from the post.


The following will work IF any additional bbcode is inserted into the post.

How i do call the bb_config regardless of additional bbcode or not?????



	<!-- Badword -->
	<match name="BadWord">
		<regex>HorribleWord</regex>
		<replace>
		<![CDATA[
		<div style='color:red;'>Word replaced</div>
		]]>
		</replace>
	</match>
cloph


Joined: 2011/11/29
Messages: 6
Offline
I'd flag the expression with
alwaysProcess="true"
and change PostCommon.java so that the method parseDefaultRequiredBBCode is always applied, i.e. move
text = parseDefaultRequiredBBCode(text);
from prepareTextForDisplayExceptCodeTag to the preparePostForDisplay as
post.setText(parseDefaultRequiredBBCode(post.getText()));


To me it also seems like a mistake/at least it is unintuitive that there is a "alwaysProcess" flag and method that contains "requiredBBCode" - but then it is not always applied.

That being said: Note that with the bbparser, the badword will still be stored to the database.
 
Forum Index » User Forum
Go to:   
Mobile view
Powered by JForum 2.5.0 © 2018 JForum Team • Maintained by Andowson Chang and Ulf Dittmer