{
switch( $badword['type'] )
{
case 'word' :
$badword['badword'] = str_replace( '*', '[\w~@#$%&()+|]', preg_quote($badword['badword']) );
//$this->search_array[] = '#('.$badword.'(?=\s|$))|((?<=\s)'.$badword.'(?=\s|[.;:,?!]|$))#i';
$this->search_array[] = '#(\b'.$badword['badword'].'\b)#i';
break;
case 'string' :
$badword['badword'] = str_replace( '*', '[\w~@#$%&()+|]', preg_quote($badword['badword']) );
$this->search_array[] = '#('.$badword['badword'].')#i';
break;
case 'regexp' :
$this->search_array[] = '#('.$badword['badword'].')#i';
break;
}
}
right before the last break