You are here

function _cleantalk_filter_response in Anti Spam by CleanTalk 8

Same name and namespace in other branches
  1. 7 cleantalk.module \_cleantalk_filter_response()
  2. 7.2 cleantalk.module \_cleantalk_filter_response()

Cleantalk inner function - performs CleanTalk comment|errstr filtering.

1 call to _cleantalk_filter_response()
_cleantalk_check_spam in ./cleantalk.module
Cleantalk inner function - performs antispam checking.

File

./cleantalk.module, line 964
Main CleanTalk integration module functions.

Code

function _cleantalk_filter_response($ct_response) {
  if (preg_match('//u', $ct_response)) {
    $err_str = preg_replace('/\\*\\*\\*/iu', '', $ct_response);
  }
  else {
    $err_str = preg_replace('/\\*\\*\\*/i', '', $ct_response);
  }
  return \Drupal\Component\Utility\Xss::filter($err_str, array(
    'a',
  ));
}