<?PHPclasstext_filter{var $words;//text functionText_filter () {$this->words=NULL; } functionWordsfilter (&$message=NULL, &$matche _row=Array()) { //$matche _row Illegal phrases if(Empty($this-words)) { Global $config; @include_once($config[' Webroot ']. ' /config/filter.inc.php '); $this->words =&$_cache[' Word_filter ']; } Else { } $message=Empty($this->words[' filter ')?$message: @Preg_replace($this->words[' filter ' [' Find '],$this->words[' filter ' [' Replace '],$message); if($this->words[' banned ' &&Preg_match($this->words[' banned '),$message,$matche _row)) { Echo"<div align= ' center ' >content contains illegal characters.<br>"; foreach($matche _row as $v) { Echo $v.‘,‘; } Echo"<br> <a href= ' javascript:history.back (); ' > Back </a> </div> '; die;//There are illegal words } Else { return $message;//information after being replaced } }}?>
Illegal word masking