You are here

function _webform_validation_check_false in Webform Validation 7

Same name and namespace in other branches
  1. 6 webform_validation.validators.inc \_webform_validation_check_false()

Helper function used by array_filter() to determine if a value is empty.

This is used in place of empty() because string '0' needs to be considered not empty and return FALSE.

Parameters

mixed $var: The value to check.

Return value

bool TRUE if $var is not one of FALSE, int 0, or empty string; FALSE otherwise.

See also

https://www.drupal.org/node/886458

https://www.drupal.org/node/2638172

2 string references to '_webform_validation_check_false'
webform_validation_webform_validation_validate in ./webform_validation.validators.inc
Implements hook_webform_validation_validate().
_webform_validation_flatten_array in ./webform_validation.validators.inc
Helper function to deal with submitted values that are arrays.

File

./webform_validation.validators.inc, line 1164
Provides validation functionality and hooks.

Code

function _webform_validation_check_false($var) {
  return $var !== FALSE && $var !== 0 && $var !== '';
}