1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[fgX] Advanced Censoring [Paid] 1.1.1

Powerful post censoring using regular expressions.

  1. farang

    farang Well-Known Member

    farang submitted a new resource:

    [fgX] Advanced Censoring - Censoring posts using regular expressions. Helps prevent spam.

    Read more about this resource...
  2. Mouth

    Mouth Well-Known Member

    Would be great to see some example configurations.
    farang likes this.
  3. farang

    farang Well-Known Member

    hi @Mouth

    There are some samples provided in the plugin to help You get started. All of them are inactive (commented out) except one.

    # Below are some sample pattern matching expressions.
    # Lines  preceded with a # sign are comments.
    # Remove mantra-like post text that ends with 2 line breaks followed by some
    # text that ends with 'alk'
    # Matching something like 'Sent from my D96-Phone using a cornstalk'
    "/\n{2}s.+alk$/i", ""
    # Replace all e-mail addresses with  the text  '[E-mail removed]'
    # (At this stage they are already BB-encoded)
    # "/\[EMAIL(.+?)\[\/EMAIL\]/i", "[E-mail removed]"
    # Replace all URLs to "somesite.com" with  the text  '[URL removed]'
    # "/\[URL(.+?)somesite\.com(.+?)\[\/URL\]/i", "[URL removed]"
    Another example:

    # Match viagra, viaaggggra, via gra, via.gra, \/|AGRA, \/I/\GR/\, v1aqra, vi@gr@ and variants
    "/[v\\]+\/?.?[i:1!\|]+.?[a@\/]+\\?.?[gq]+.?r+.?[a@\/]+\\?/i", "[Medicin]"
    The example above is quite powerful since it can catch a lot of common alternative spellings of a word. Using the standard built in censoring would require hundreds of entries (probably thousands) to do the same thing. :D
  4. Mouth

    Mouth Well-Known Member

    Is there a regex generator or checker somewhere (site?) that you could suggest I can build and test regex expressions that I would likely use?
  5. farang

    farang Well-Known Member

    What we use is PCRE regular expressions. There are a few checker sites out there. I prefer https://regex101.com/
    But don't use the "g" modifier in your defined search patterns. It's implicit with preg_replace()

  6. farang

    farang Well-Known Member

  7. semprot

    semprot Active Member

    @farang : does this work on 1.5.11?

    Thank you.
  8. farang

    farang Well-Known Member

    Hi! It's been tested at version 1.5 and up and there shall be no problem.
    Last edited: Nov 18, 2016
    semprot likes this.
  9. R3cK17

    R3cK17 New Member

    Will this prevent the censored word being visible in the bb code editor?
    For example: the XF Censor will cover the word only in rech text, you can quote/reply and the text is plainly visible.

    I am looking for something to fix that as it is the only problem I have with the XF integrated version, but also want it site-wide, so chat add-ons and private messages are still covered. Can this cover all of that?
  10. farang

    farang Well-Known Member

    This add-on works only for new messages that gets posted. The replacement is permanently committed into posted messages. (It actually changes the posted text) The replacement is occurring at the moment when someone makes a post. I hope that helps. ;)
    R3cK17 likes this.

Share This Page