HOW TO prevent insertion of rude words or spam(words filter)

Talk and info about common issues

Moderator: alexandrleonenko

administrator
Site Admin
Site Admin
Posts: 6005
Joined: Jan 7th, '09, 23:18
Contact:

HOW TO prevent insertion of rude words or spam(words filter)

Postby administrator » Mar 7th, '12, 08:31

Open include/functions.common.inc.php file, find there prepare_input() function.
There are 3 arrays of bad words in this function:

Code: Select all

if($level == 'low'){
      $bad_string = array(...);
   }else if($level == 'medium'){
      $bad_string = array(...);
   }else if($level == 'high'){
      $bad_string = array(...);
   }else if($level == 'extra'){
      $bad_string = array(...);
}


Now add your own words that you want to filter, for example:

Code: Select all

$bad_string = array('stupid', 'replica', 'watch', .....);

Return to “ApPHP MicroCMS {HOW TO}”