"") $times = preg_match_all($word,$output,$matches); else $times = 0; for ($x=0; $x<$times; $x++){ if (strlen($matches[0][$x]) < strlen($matches[1][$x])){ $shortword = $matches[0][$x]; $longword = $matches[1][$x]; }else{ $shortword = $matches[1][$x]; $longword = $matches[0][$x]; } if (isset($exceptions[strtolower($longword)])){ $x--; $times--; if ($debug) output("This word is ok because it was caught by an exception: `b`^%s`7`b`n",$longword); }else{ if ($debug) output("`7This word is not ok: \"`%%s`7\"; it blocks on the pattern `i%s`i at \"`\$%s`7\".`n",$longword,$word,$shortword); // if the word should be filtered, drop it from the // search terms ($output), and mask its bytes out of // the output mask. $len = strlen($shortword); $pad = str_pad("",$len,"_"); //while (($p = strpos($output,$shortword))!==false){ $p = strpos($output,$shortword); $output = substr($output,0,$p) . $pad . substr($output,$p+$len); $mix_mask = substr($mix_mask,0,$p) . $pad . substr($mix_mask,$p+$len); //} $changed_content = true; }//end if }//end for } while ($times > 0); } $y = 0; //position within final output $pad = '#@%$!'; for ($x=0; $x$input)); return $final_output; } }else{ return $final_output; } } function good_word_list(){ $sql = "SELECT * FROM " . db_prefix("nastywords") . " WHERE type='good'"; $result = db_query_cached($sql,"goodwordlist"); $row = db_fetch_assoc($result); return explode(" ",$row['words']); } function nasty_word_list(){ $search = datacache("nastywordlist",600); if ($search!==false && is_array($search)) return $search; $sql = "SELECT * FROM " . db_prefix("nastywords") . " WHERE type='nasty'"; $result = db_query($sql); $row = db_fetch_assoc($result); $search = " ".$row['words']." "; $search = preg_replace('/(?<=.)(?