hi guys i have a chat script and there is a commands call /filter but some trouble makers played with this command they filter the hole page by these words (java, face, color, font .......ect) so can any one tell me how to stop them and also they can filter the text decoration and much more words this is the code
------------------------------
$amer = "size=2 face=\"tahoma\"";
if ($com[1] eq ""
{
$err = "*** Sorry, no string provided to be filtered from the public screen!";
}elsif ($com[1] =~ /\~/ || $com[1] =~ /\`/ || $com[1] =~ /\!/ || $com[1] =~ /\@/ || $com[1] =~ /\#/ || $com[1] =~ /\$/ || $com[1] =~ /\%/ || $com[1] =~ /\^/ || $com[1] =~ /\&/ || $com[1] =~ /\*/ || $com[1] =~ /\(/ || $com[1] =~ /\)/ || $com[1] =~ /\-/ || $com[1] =~ /\+/ || $com[1] =~ /\=/ || $com[1] =~ /\}/ || $com[1] =~ /\]/ || $com[1] =~ /\{/ || $com[1] =~ /\[/ || $com[1] =~ /\"/ || $com[1] =~ /\'/ || $com[1] =~ /\:/ || $com[1] =~ /\;/ || $com[1] =~ /\?/ || $com[1] =~ /\// || $com[1] =~ /\>/ || $com[1] =~ /\ava/ || $com[1] =~ /\</ || $com[1] =~ /\,/ || $com[1] =~ /\java/ || $com[1] =~ /color/ || $com[1] =~ /font/ || $com[1] =~ /\\/ || $com[1] =~ /raito/ || $com[1] =~ /\|/){
$err = "*** Invalid filtering: Only aA-zZ, 0-9, and _ characters are allowed in filtering, because some other characters cause some script problems!";
}else{
open(hhh,"public/$IN{'room'}.txt"
;
flock (hhh,2);
@getall = <hhh>;
close(hhh);
open(hhh,">public/$IN{'room'}.txt"
;
flock (hhh,2);
if (length $com[1] >= 3) {
foreach $uff (@getall) {
$x = rindex($uff,$com[1]);
if ($x >= 0) {
push(@thefl,"$uff"
;
}else{
print hhh $uff;
}
}
}elsif(length $com[1] < 3 && $IN{'rank'} >= 24 ) {
foreach $uff (@getall) {
$x = rindex($uff,$com[1]);
if ($x >= 0) {
push(@thefl,"$uff"
;
}else{
print hhh $uff;
}
}
}else {
foreach $uff (@getall) {
print hhh $uff;
}
$err = "<font $amer>*** 3 or more characters are required to filter ***</font>"
}
if(-e "public_rooms/$IN{'room'}.txt"
{
if($data[6] eq $IN{'name'}){
$teltu = "<b>$IN{'name'}</b>";
}else{
$teltu = "<b>$IN{'name'}</b> ($data[6])";
}
#open(hhh2,">>loggers/loggers3.txt"
; #### CHANGED FROM loggers3.txt to filtered.txt
open(hhh2,">>loggers/filtered.txt"
;
flock (hhh2,2);
if($thefl[0] ne ""
{
print hhh2 "<font $amer color=\"cc33ff\">**************************************************<br>*** Op $teltu<font color=white size=-3>i</font> filtered the following:</font>";
foreach $wak(@thefl){
chop($wak);
print hhh2 "<br><font $amer color=\"cc33ff\">$wak</font>";
}
print hhh2 "<br><font color=\"cc33ff\">**************************************************</font>";
}else{
print hhh2 "<font $amer color=\"cc33ff\">**************************************************<br>*** Op $teltu<font color=white size=-3>i</font> filtered <i>nothing</i></font><br>";
print hhh2 "<font $amer color=\"cc33ff\">**************************************************</font>";
}
print hhh2 "</font></font></font>\n";
close(hhh2);
}
open(hhh,">>public/$IN{'room'}.txt"
;
flock (hhh,2);
if (length $com[1] >= 3 || length $com[1] < 3 && $IN{'rank'} >= 24) {
print hhh "<font $amer color=\"000000\">*** String ($com[1])<font color=white size=-3>i</font> filtered by <b>$IN{'name'}</b><font color=white size=-3>i</font>.</font>\n";
}
close(hhh);
}
------------------------------
$amer = "size=2 face=\"tahoma\"";
if ($com[1] eq ""
$err = "*** Sorry, no string provided to be filtered from the public screen!";
}elsif ($com[1] =~ /\~/ || $com[1] =~ /\`/ || $com[1] =~ /\!/ || $com[1] =~ /\@/ || $com[1] =~ /\#/ || $com[1] =~ /\$/ || $com[1] =~ /\%/ || $com[1] =~ /\^/ || $com[1] =~ /\&/ || $com[1] =~ /\*/ || $com[1] =~ /\(/ || $com[1] =~ /\)/ || $com[1] =~ /\-/ || $com[1] =~ /\+/ || $com[1] =~ /\=/ || $com[1] =~ /\}/ || $com[1] =~ /\]/ || $com[1] =~ /\{/ || $com[1] =~ /\[/ || $com[1] =~ /\"/ || $com[1] =~ /\'/ || $com[1] =~ /\:/ || $com[1] =~ /\;/ || $com[1] =~ /\?/ || $com[1] =~ /\// || $com[1] =~ /\>/ || $com[1] =~ /\ava/ || $com[1] =~ /\</ || $com[1] =~ /\,/ || $com[1] =~ /\java/ || $com[1] =~ /color/ || $com[1] =~ /font/ || $com[1] =~ /\\/ || $com[1] =~ /raito/ || $com[1] =~ /\|/){
$err = "*** Invalid filtering: Only aA-zZ, 0-9, and _ characters are allowed in filtering, because some other characters cause some script problems!";
}else{
open(hhh,"public/$IN{'room'}.txt"
flock (hhh,2);
@getall = <hhh>;
close(hhh);
open(hhh,">public/$IN{'room'}.txt"
flock (hhh,2);
if (length $com[1] >= 3) {
foreach $uff (@getall) {
$x = rindex($uff,$com[1]);
if ($x >= 0) {
push(@thefl,"$uff"
}else{
print hhh $uff;
}
}
}elsif(length $com[1] < 3 && $IN{'rank'} >= 24 ) {
foreach $uff (@getall) {
$x = rindex($uff,$com[1]);
if ($x >= 0) {
push(@thefl,"$uff"
}else{
print hhh $uff;
}
}
}else {
foreach $uff (@getall) {
print hhh $uff;
}
$err = "<font $amer>*** 3 or more characters are required to filter ***</font>"
}
if(-e "public_rooms/$IN{'room'}.txt"
if($data[6] eq $IN{'name'}){
$teltu = "<b>$IN{'name'}</b>";
}else{
$teltu = "<b>$IN{'name'}</b> ($data[6])";
}
#open(hhh2,">>loggers/loggers3.txt"
open(hhh2,">>loggers/filtered.txt"
flock (hhh2,2);
if($thefl[0] ne ""
print hhh2 "<font $amer color=\"cc33ff\">**************************************************<br>*** Op $teltu<font color=white size=-3>i</font> filtered the following:</font>";
foreach $wak(@thefl){
chop($wak);
print hhh2 "<br><font $amer color=\"cc33ff\">$wak</font>";
}
print hhh2 "<br><font color=\"cc33ff\">**************************************************</font>";
}else{
print hhh2 "<font $amer color=\"cc33ff\">**************************************************<br>*** Op $teltu<font color=white size=-3>i</font> filtered <i>nothing</i></font><br>";
print hhh2 "<font $amer color=\"cc33ff\">**************************************************</font>";
}
print hhh2 "</font></font></font>\n";
close(hhh2);
}
open(hhh,">>public/$IN{'room'}.txt"
flock (hhh,2);
if (length $com[1] >= 3 || length $com[1] < 3 && $IN{'rank'} >= 24) {
print hhh "<font $amer color=\"000000\">*** String ($com[1])<font color=white size=-3>i</font> filtered by <b>$IN{'name'}</b><font color=white size=-3>i</font>.</font>\n";
}
close(hhh);
}