![]() |
FractalizeR: Extended Post Censor
What this hack does?
This hack is a post censor, that will replace unwanted words and phrases by the values you specify. Features:
Some use cases:
Version was tested under VB 3.6.8, but supposed to work on any 3.6.x release. Please report all compatibility issues here. Please look at control panel screenshot below (please mind, that I am russian and screenshots are from russian forum, so for example usergroup names are incorrectly displayed when I set langauge to English). |
hmm looks really good. I know a lot of people try to bypass the filters with spaced.
Just wondering, can this also bypass other characters besides the basic alphabet? Because I know people were using other characters that look like the alphabet to bypass the filters, not sure if your hack can filter it or not? |
cool!
|
Quote:
|
I'm not sure if I did something wrong or not, but it's not working. The text isn't showing up and I'm getting the following errors.
Warning: array_keys() [function.array-keys]: The first argument should be an array in \includes\class_postbit.php(296) : eval()'d code on line 15 Warning: array_values() [function.array-values]: The argument should be an array in \includes\class_postbit.php(296) : eval()'d code on line 15 Warning: array_keys() [function.array-keys]: The first argument should be an array in \includes\class_postbit.php(296) : eval()'d code on line 23 Warning: array_values() [function.array-values]: The argument should be an array in \includes\class_postbit.php(296) : eval()'d code on line 23 Warning: preg_replace() [function.preg-replace]: Empty regular expression in \includes\class_postbit.php(296) : eval()'d code on line 23 I'm using 3.6.8 on a local Xampp server. Brandon |
Could you please show me a screenshot of your settings in control panel?
|
I had done several of my arrays, but always came up with the same result. I ended up just copying and pasting your sample array even though I don't see anyone typing "StringIWantToReplaceInto1" anytime soon. :) Still, no luck.
Brandon |
[high]* projectego clicks install :)[/high]
|
brandondrury, have you get rid of those nasty error messages? I cannot reproduce this situation on my forum. About filter - have you set usergroups this filter should be applied to? Filtering will work only for usergroups you select.
Does someone who also installed this hack has any problems with it? |
I havn't tried it yet, i'm still fiddling with the expressions. How would I go about doing the same for multiple question marks? When I put a ? in there, it tells me that there is something wrong with my expression.
Here is what I have in the Regular Expression part: Code:
Return(array( Code:
Return(array( |
Yes, '?' is a special sign in regular expressions language that means, that preceding symbol can be in string, or can be omitted. You need to escape it by '\' to use as a string.
To replace many question marks by some string use the following regex: '/\?{3,}/' => '???' The expression in {} tells, that preceding symbol is repeated three or more times. We can write {,3} for example and it will mean, that something repeated up to three times. We can specify {3,6} and it will mean, that something is repeated from 3 to 6 times. dot (".") means one any symbol. plus ("+") means, that preceding symbol or expression is repeated one or more times. It is actually equal to {1,}. asterisk ("*") means, that preceding symbol or expression is repeated zero or more times. \d - means one any digit. \s - means any space character For example we can replace multiple spaces by one: '/\s+/' => '' " - remember, + means "one or more" If you need to apply + or * or any other "quantifier" to several characters you need to put these characters into brackets: /(abc)+/ => "abc" - replace one or more abc sttrings by one copy so that "abcabcabc" becomes "abc" So, about your case - yes, all correct, just escape ? by \ |
Got it, thanks so much!
One question, since I can't test this until my site goes live... does this work in post preview, or just when they submit the post? |
Actually, censor makes no changes to DB. So, words are replaced on post is displayed.
Preview is not affected preventing users from experimenting with filter faking. |
Hi!
Tell me please, is it possible to censor/replace the whole message, if it contains unwanted word? Thanks ) |
Quote:
|
Quote:
'/.*UnwantedWord.*/' => 'I don't like this message!' |
Interesting concept and one our forums could benefit from if the follow works as desired.
What would happen if you wanted to replace the "U" with "You" in the following sentence: "U should bring an umbrella." Would the outcome be "You should bring an umbrella." or You shoyould bring an youmbrella."? |
This is working nicely, thank you!
How would I have it reduce "?!?!?!?!?" to just "?!" I kno wmy members will 'get around' it by alternating them. :P |
Quote:
/\w+u\w+/ =>"you" \w - is any "non-word" character Quote:
"/((\?\!)|(\!\?))+/" = > "?!" It means, replace any number of "?!" or "!?" sequences by single "?!". "|" - means "or" Small update: to prevent users from using different combinations of "!", "?" and spaces one may try something like this: "/((\!\s*)|(\?\s*)){3,}/" => "Exclamation!" |
Quote:
But i have the same problem as brandondrury :( same mistakes and no messages on my forum shown at all. |
Are you running 3.6.8 on your server? Could you please try to uninstall and reinstall my hack? It seem like no settings are saved or evaluated inside plugin.
|
When searching for words to replace, will it also search for ones with spaces? For example, if you block "example", will it also block "ex am ple" on the fly? If not, this is exactly like the Replacement Variable Manager that's built into the forum.
Now, having a regex area is kind of nice, but I could swear that's built into the forum as well, just can't remember where I've seen it in the AdminCP. |
no, 3.6.7 at the moment.
I'll upgrade and try again ) |
Would this work with changing quotes from:
Quote:
Quote:
|
Quote:
Quote:
Quote:
|
Brilliant, exactly what I need, will install later.
|
Will this hack censor thread titles as well as the post body text?
|
Quote:
Quote:
vB 3.6.8 PHP 4.4.4 MySQL Version 4.1.22-standard I tried the same Control Panel settings as brandondrury, as well as my own custom regex. This mod looks perfect for my forum. I hope we can find a solution:( |
I think I found a solution for this problem: http://gallery.menalto.com/node/57633
some guy was running into the same problem with another chunk of code he was writing. Quote:
Cheers Aaron |
It is not a problem of my hack, I think. It seem like PHP bug or misconfiguration.
May be also at main VBulletin settings something related to cookies or session is misconfigured. About titles - they are not affected. |
Darn, I was hoping it might do titles too. That's one of the big things that would be usefull to censor on my forum.
I'll take a look into the hack & settings to see if I can make it work.... What version of PHP are you running? |
I am running 5.2.1. But hack should work on all PHP versions, that VB support.
I will also take a look. The problem is, that thread titles are displayed in many templates and deep hacking is needed. |
hi fractalizer
i wanna use your hack to filter mails directions. so everytime that some user writes somebody@someserver.another.com the hack will replace it with XXXXXX@XXXX.XXX i don?t have idea of expressions, so i dont know, how can i do it :$ so it?ll be very grateful if you guide me to do that |
Quote:
It is simply that you need to put a comma after the single quote if there is going to be ANOTHER thing to censor after it. In other words the comma should be after each one with the exception of the last one so it SHOULD look like this PHP Code:
|
One thing that I might just be missing or it might not exist,
the ability to remove case sensitive blocking. So that if it is at the beginning of a sentence and is capitalized it still gets blocked. |
Quote:
Even if I try it with the default installed blank setting I get the errors. I used this: Code:
return(array()); Code:
return(array( WTF, just got a msn from a board member while I was testing... setting says its set to admins only, but my friend got the same errors and he is just a regular basic user, so this mod should not even be affecting him.... Quote:
|
Quote:
'/\s+[A-Za-z_\.]+@[A-Za-z_]+\.[A-Za-z_]+\s+/' =>'XXX@XXX.XXX' 2Big_Ern: Still cannot reproduce error on my PC, but will check these days. |
i just find it odd that me & bandonury are getting the same error.... I'm trying to think what might be causing it, but my forum has no other mods installed and I am on a good host that usually never has any tech problems r limitations like some of the free hosts....
thanks for looking into it. I hope we can find a solution, as I would love to install your mod:cool: |
Is there anyway this could work for people using different cases. I don't care if they use different characters to get the word across, that is against my forums rules and they will be warned, but I hate punishing those who know of the censor and just type the word anyway expecting it to be blocked but then because it was at the beginning of a sentence or they write in all caps it gets by.
|
Make it case insensitive
Quote:
|
All times are GMT. The time now is 07:08 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|