function cleantalk_uc_order in Anti Spam by CleanTalk 8.4
Same name and namespace in other branches
- 8 cleantalk.module \cleantalk_uc_order()
- 8.3 cleantalk.module \cleantalk_uc_order()
- 7.5 cleantalk.module \cleantalk_uc_order()
- 7 cleantalk.module \cleantalk_uc_order()
- 7.2 cleantalk.module \cleantalk_uc_order()
- 7.4 cleantalk.module \cleantalk_uc_order()
- 9.1.x 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']);
}
}
}