You are here

function _restrict_abusive_words_search_words in Restrict Abusive Words 7

Same name and namespace in other branches
  1. 8 restrict_abusive_words.module \_restrict_abusive_words_search_words()
  2. 7.2 restrict_abusive_words.module \_restrict_abusive_words_search_words()

Check the word or phrase is exist in the abusive word list.

8 calls to _restrict_abusive_words_search_words()
_restrict_abusive_words_comment_form_submit in ./restrict_abusive_words.module
Callback function to submit node comment form for abusive words.
_restrict_abusive_words_comment_form_validate in ./restrict_abusive_words.module
Callback function to validate node comment form for abusive words.
_restrict_abusive_words_node_form_submit in ./restrict_abusive_words.module
Implement _restrict_abusive_words_node_form_submit.
_restrict_abusive_words_node_form_validate in ./restrict_abusive_words.module
Callback function to validate node form for abusive words.
_restrict_abusive_words_user_form_submit in ./restrict_abusive_words.module
Callback function to submit user related form for abusive words.

... See full list

File

./restrict_abusive_words.module, line 425
Restrict Abusive Words module.

Code

function _restrict_abusive_words_search_words($words, $string) {
  if (!empty($string) && isset($words)) {
    foreach ($words as $word) {
      if (preg_match("/\\b{$word}\\b/i", $string)) {
        return $word;
      }
    }
  }
  return FALSE;
}