會員註冊 / 登入  |  電腦版  |  Jump to bottom of page

User Forum » Bad / Censored word list

發表人: al
10 年 前
 

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
10 年 前
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.




會員註冊 / 登入  |  電腦版  |  Jump to top of page