You are here

function get_data_from_submit in Anti Spam by CleanTalk 7

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

Inner function - Finds and returns pattern in string

Return value

null|bool

1 call to get_data_from_submit()
get_fields_any in ./cleantalk.module

File

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

Code

function 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;
  }
}