You are here

public static function CleantalkFuncs::_cleantalk_filter_response in Anti Spam by CleanTalk 8.3

Same name and namespace in other branches
  1. 8.4 src/CleantalkFuncs.php \Drupal\cleantalk\CleantalkFuncs::_cleantalk_filter_response()
  2. 9.1.x src/CleantalkFuncs.php \Drupal\cleantalk\CleantalkFuncs::_cleantalk_filter_response()

Cleantalk inner function - performs CleanTalk comment|errstr filtering.

1 call to CleantalkFuncs::_cleantalk_filter_response()
CleantalkFuncs::_cleantalk_check_spam in src/CleantalkFuncs.php
Cleantalk inner function - performs antispam checking.

File

src/CleantalkFuncs.php, line 519

Class

CleantalkFuncs
Cleantalk class create request

Namespace

Drupal\cleantalk

Code

public static 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',
  ));
}