Advanced Censoring (Post Content Replacement) [Deleted]

farang

Well-known member
farang submitted a new resource:

Advanced Censoring (Post Content Replacement) - Censoring posts using regular expressions. Helps prevent spam.

XenForo has a nice built in function to censor words when displaying messages. Unlike the XenForo word censoring function, the replacements made by this versatile add-on is permanently committed into posted messages. The replacement is occurring at the moment when someone makes a post.

The benefits of using a regular expression instead of a fixed word is that the possibilities are vast. A regular expression is a compact way of describing sets of strings which conform to a pattern.

For...

Read more about this resource...
 
Last edited:
farang updated Advanced censoring (Post Content Replacement) with a new update entry:

Version 0.9.0 Released

Changes:
  • Replaced the default sample expressions with better ones.
New functions:
  • Added an Exclude Forum selection list.
    wai.gif
    wai.gif
    wai.gif

Read the rest of this update entry...
 
Last edited:
that you farang

it works also while editing?

Yes it's supposed to recensor the post if it's edited. ;-)

It will not do anything if you just edit and save (without making any actual changes) . If You edit and change something the post will be recensored when you save it.
 
Last edited:
This morning I was experimenting a bit with some more matching patterns.

Suppose you want to replace a word but the poster has been inventive enough to spell it a bit differently than conventional. In the example below we have used the word biagra. It's just an example how Advanced Censoring could be used if you wanted to. Nothing else.
As always use two comma separated and "-enclosed strings on a single line

Code:
# Find biagra, biaaggggra, bia gra, bia.gra, \/|AGRA, \/I/\GR/\, b1aqra, bi@gr@ and other variants:
"/[vb\\]+\/?.?[i:1!\|]+.?[a@\/]+\\?.?[gq]+.?r+.?[a@\/]+\\?/i", "[Replaced]"

I used to validate rexex at http://regexr.com/ but I have found https://regex101.com/ much better since it uses PCRE regular expressions.

P.S. The ending of the string "i" is a modifier that makes the comparison case insensitive. The "g" modifier is implicit with preg_replace(), you shouldn't include it.
 
Last edited:
If you have some spare time, I'd love to have some feedback (and possible also a review) from you guys using this add-on. Ideas for improvements are also appreciated. Thanks and happy holidays! ;)
 
Back
Top Bottom