Previous Thread
Next Thread
Print Thread
Rate Thread
#223479 09/01/2002 1:43 PM
Joined: Aug 2002
Posts: 51
Power User
Power User
Offline
Joined: Aug 2002
Posts: 51
pretty useless
xxBADWORDxx isnt filtered. it takes a 15 year old about 3 seconds to figure this out and beginning spamming



Edit Note: As suggested by Dave_L I moved this thread here so that others may find the code easier and of use.

Last edited by JustDave; 09/01/2002 11:42 PM.
Sponsored Links
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
I'm sure I could give you the code to make the filters cover embeded "bad words". Jut keep in mind that there are valid words that contain "bad words" if you look for them. The word "pass" does not equil "p[censored]"

Also, the lengths you will have to go to to filter everything will always increase as every road block you put up is just another challenge for the person that want's to avoid it.

Would this be a bad word? "You can kiss my A S S !" ?

If you started using wildcards * to filter these bad words how many other words would be snared? If a wild card was used to catch something like the example above, using a*s*s in the filter then a sentance such as "I asked and he said no." would look like I [censored]aid no." which would really put a damper on forums, I believe.

I'll put some stronger filter code together sometime this week when I get a chance. Keep in mind that your filtering mileage may very with it's use.

Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
In your addpost.php script at around line 495 you should see something that looks like this:

code:

$badwords = join("|", $words);
$badwords = preg_replace("/^\|/","",$badwords);
$Subject = preg_replace("/\b($badwords)\b/i",$config['censored'],$Subject);
$Body = preg_replace("/\b($badwords)\b/i",$config['censored'],$Body);



replace it with this:

code:

$badsize = sizeof($words);
for ($xy=0; $xy<$badsize; $xy++) {
if (!empty($words[$xy]) && $words[$xy] != " ") {
$thisstring = str_replace("*",".*",$words[$xy]);
$BadSubjectCount = eregi($thisstring,$Subject,$BadSubjectArray);
$BadBodyCount = eregi($thisstring,$Body,$BadBodyArray);
if ($BadSubjectCount >= 1 ) {
for ($zy=0; $zy<$BadSubjectCount; $zy++) {
$Subject = str_replace($BadSubjectArray[$zy],$config['censored'],$Subject);
}
}
if ($BadBodyCount >= 1 ) {
for ($zy=0; $zy<$BadBodyCount; $zy++) {
$Body = str_replace($BadBodyArray[$zy],$config['censored'],$Body);
}
}
}
}



This will replace many more instances of the words and if you use wildcards * it could very well replace the whole post with [censored]. LoL

There's probably a regular expression that will do the same job as this code but I'm not a regexp guru though.

Last edited by JustDave; 09/01/2002 5:10 PM.
Joined: Jun 2001
Posts: 3,273
That 70's Guy
That 70's Guy
Offline
Joined: Jun 2001
Posts: 3,273
*bump*

Joined: Aug 2002
Posts: 51
Power User
Power User
Offline
Joined: Aug 2002
Posts: 51
I didnt really mean to post this as a mod suggestion, I really was just trying the filters out.

ubb.classic had two options for filters.. I could enter

[curse]
and it would only filter that exact word.. XXcurseXX would not be filtered.


curse2
(without the [])
and this WOULD filter XXcurse2XX. It would NOT filter xxCURxSE2xx

This duel method allowed me to precisely select how/what I wanted filtered and eliminate a lot of the problems you mentioned above


I know I could never filter a*s*s* but with the method above I can eliminate 99% of it.

Im not sure if anyone would do this as a mod.... The reason I need tighter filters is because MOST of my members are 12-16 (and pretty stupid).

I am going to install the code above soon... Ive got a long list of stuff im installing now

Thanks Dave.. I appreciate all the time and effort you give to everyone here..

Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,575
Posts293,931
Members13,823
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Gizmo 1
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)