You are here

function cleantalk_get_data_from_submit in Anti Spam by CleanTalk 7.2

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

Inner function - Finds and returns pattern in string

Return value

null|bool

1 call to cleantalk_get_data_from_submit()
cleantalk_get_fields_any in ./cleantalk.module
gets data for checking recursively

File

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

Code

function cleantalk_get_data_from_submit($value = null, $field_name = null) {
  if (!$value || !$field_name || !is_string($value)) {
    return false;
  }
  if (preg_match("/[a-z0-9_\\-]*" . $field_name . "[a-z0-9_\\-]*\$/", $value)) {
    return true;
  }
}