You are here

function _field_hidden_check_plaintext in Field Hidden 7

Checks that arg $str doesnt seem to contain html markup.

Parameters

string $str:

Return value

bool

1 call to _field_hidden_check_plaintext()
field_hidden_field_validate in ./field_hidden.module
Validation of field items upon form submission.

File

./field_hidden.module, line 521
Drupal Field Hidden module

Code

function _field_hidden_check_plaintext($str) {
  return ($le = strlen($str)) === strlen(preg_replace('/<[\\/a-zA-Z][^<>]*>/', '', rawurldecode($str))) && $le === strlen(strip_tags($str));

  // strip_tags is not very strict when it comes to tags, but it checks for more stuff
}