<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 />