You are here

function cleantalk_uc_order in Anti Spam by CleanTalk 9.1.x

Same name and namespace in other branches
  1. 8.4 cleantalk.module \cleantalk_uc_order()
  2. 8 cleantalk.module \cleantalk_uc_order()
  3. 8.3 cleantalk.module \cleantalk_uc_order()
  4. 7.5 cleantalk.module \cleantalk_uc_order()
  5. 7 cleantalk.module \cleantalk_uc_order()
  6. 7.2 cleantalk.module \cleantalk_uc_order()
  7. 7.4 cleantalk.module \cleantalk_uc_order()

File

./cleantalk.module, line 428

Code

function cleantalk_uc_order($op, $order, $arg2) {
  global $cleantalk_executed;
  $ct_temp_msg_data = CleantalkHelper::get_fields_any(\Drupal::request()->request
    ->all(), \Drupal::config('cleantalk.settings')
    ->get('cleantalk_fields_exclusions'));
  $spam_check = array();
  $spam_check['type'] = 'comment';
  $spam_check['sender_email'] = $ct_temp_msg_data['email'] ? $ct_temp_msg_data['email'] : '';
  $spam_check['sender_nickname'] = $ct_temp_msg_data['nickname'] ? $ct_temp_msg_data['nickname'] : '';
  $spam_check['message_title'] = $ct_temp_msg_data['subject'] ? $ct_temp_msg_data['subject'] : '';
  $spam_check['message_body'] = $ct_temp_msg_data['message'] ? implode("\n", $ct_temp_msg_data['message']) : '';
  if ($spam_check['sender_email'] != '' && !$cleantalk_executed && $op != 'total' && $op != 'presave' && $op != 'save') {
    $spam_result = CleantalkFuncs::_cleantalk_check_spam($spam_check);
    $cleantalk_executed = true;
    if (isset($spam_result) && is_array($spam_result) && $spam_result['errno'] == 0 && $spam_result['allow'] != 1 && $spam_result['stop_queue'] == 1) {
      CleantalkFuncs::_cleantalk_die($spam_result['ct_result_comment']);
    }
  }
}