UBB.Dev
Posted By: ehm Bad words on signature. How to remove? - 01/08/2003 5:43 PM
I realize today that 'Bad Words' script doesn't remove/change if one user decide to put a bad word on his/her signature (more "his" than "her" ... ) There is any way to control it?
I'm using 6.2
Posted By: bud Re: Bad words on signature. How to remove? - 01/08/2003 7:07 PM
1. Make a copy of changebasic.php just in case
2. Add the following below line 238 of changebasic.php (the block of code that deals with getting rid of html in the signature)

Code
<br />// ---------------------------------------------------------------------<br />// Substitute any filters/badwords with the $config[censored] variable in the signature<br />   $words[0] = "";<br />   if ($config['censored']) {<br />      $badwords = @file("{$config['path']}/filters/badwords");<br />      if (!is_array($badwords)) {<br />         $badwords = @file ("{$config['phpurl']}/filters/badwords");<br />      }<br />      while (list($linenum,$line) = each($badwords) ) {<br />         $line = chop($line);<br />         if ( (preg_match("/^\r/",$line)) || (preg_match("/^\n/",$line)) ) {<br />            continue; <br />         }<br />         $islines = 1;<br />         $words[count($words)] = $line;<br />         // PHP4 ONLY<br />         // array_push ($words, $line);<br />      }<br />      if ($islines) {<br />         $badwords = join("|", $words);<br />         $badwords = preg_replace("/^\|/","",$badwords);<br /> <br />         $Signature = preg_replace("/\b($badwords)\b/i",$config['censored'],$Signature);<br />       }<br />   }<br />
Posted By: ehm Re: Bad words on signature. How to remove? - 01/09/2003 6:08 AM
Work like a charme
THank you Bud.
So far no bad words
That is great. No bad word in signatures.

Is there a way to have no bad word, filters, in private messages?
Posted By: bud Re: Bad words on signature. How to remove? - 01/13/2003 10:01 PM
Sure.

1. Make a backup of sendmessage.php and mess_reply.php
2. Add the following code beneath line 123 in sendmessage.php
3. Add the same code beneath line 100 in mess_reply.php

Code
<br />// ---------------------------------------------------------------------<br />// Substitute any filters/badwords with the $config[censored] variable in the <br />//  message or subject   <br />   $words[0] = "";   <br />   if ($config['censored']) {<br />       $badwords = @file("{$config['path']}/filters/badwords");<br />       if (!is_array($badwords)) {<br />       	  $badwords = @file ("{$config['phpurl']}/filters/badwords");<br />       }<br />       while (list($linenum,$line) = each($badwords) ) {<br />          $line = chop($line);<br />          if ( (preg_match("/^\r/",$line)) || (preg_match("/^\n/",$line)) ) {<br />          	continue;<br />       }<br />       $islines = 1;<br />       $words[count($words)] = $line;<br />       // PHP4 ONLY         <br />       // array_push ($words, $line);      <br />   }<br />   if ($islines) {         <br />       $badwords = join("|", $words);<br />       $badwords = preg_replace("/^\|/","",$badwords);<br />       <br />       $Message = preg_replace("/\b($badwords)\b/i",$config['censored'],$Message);<br />       $Subject = preg_replace("/\b($badwords)\b/i",$config['censored'],$Subject);<br />       }<br />   }<br />   $FormBody = $Message;<br />   $FormSubject = $Subject;<br />
© UBB.Developers