Révision 4f315dab
Ajouté par Assos Assos il y a environ 8 ans
drupal7/sites/all/modules/webform_validation/webform_validation.validators.inc | ||
---|---|---|
330 | 330 |
), |
331 | 331 |
'custom_error' => TRUE, |
332 | 332 |
'custom_data' => array( |
333 |
'label' => t('Regex code'), |
|
334 |
'description' => t('Specify regex code to validate the user input against.'), |
|
333 |
'label' => t('Regex code (case-sensitive)'),
|
|
334 |
'description' => t('Specify regex code to validate the user input against. Do not include delimiters such as /.'),
|
|
335 | 335 |
), |
336 |
'description' => t('Validates user-entered text against a specified case-sensitive regular expression. Note: don\'t include delimiters such as /.'),
|
|
336 |
'description' => t('Validates user-entered text against a case-sensitive regular expression.'),
|
|
337 | 337 |
), |
338 | 338 |
'regexi' => array( |
339 | 339 |
'name' => t('Regular expression, case-insensitive'), |
... | ... | |
347 | 347 |
), |
348 | 348 |
'custom_error' => TRUE, |
349 | 349 |
'custom_data' => array( |
350 |
'label' => t('Regex code'), |
|
351 |
'description' => t('Specify regex code to validate the user input against.'), |
|
350 |
'label' => t('Regex code (case-insensitive)'),
|
|
351 |
'description' => t('Specify regex code to validate the user input against. Do not include delimiters such as /.'),
|
|
352 | 352 |
), |
353 |
'description' => t('Validates user-entered text against a specified case-insensitive regular expression. Note: don\'t include delimiters such as /.'),
|
|
353 |
'description' => t('Validates user-entered text against a case-insensitive regular expression.'),
|
|
354 | 354 |
), |
355 | 355 |
'must_be_empty' => array( |
356 | 356 |
'name' => t('Must be empty'), |
... | ... | |
1030 | 1030 |
} |
1031 | 1031 |
|
1032 | 1032 |
/** |
1033 |
* Helper function used by array_filter to determine if a value was selected or not |
|
1033 |
* Helper function used by array_filter() to determine if a value is empty. |
|
1034 |
* |
|
1035 |
* This is used in place of empty() because string '0' needs to be considered |
|
1036 |
* not empty and return FALSE. |
|
1037 |
* |
|
1038 |
* @param mixed $var |
|
1039 |
* The value to check. |
|
1040 |
* |
|
1041 |
* @return bool |
|
1042 |
* TRUE if $var is not one of FALSE, int 0, or empty string; FALSE otherwise. |
|
1043 |
* |
|
1044 |
* @see https://www.drupal.org/node/886458 |
|
1045 |
* @see https://www.drupal.org/node/2638172 |
|
1034 | 1046 |
*/ |
1035 | 1047 |
function _webform_validation_check_false($var) { |
1036 |
return $var !== FALSE && $var !== 0; |
|
1048 |
return $var !== FALSE && $var !== 0 && $var !== '';
|
|
1037 | 1049 |
} |
1038 | 1050 |
|
1039 | 1051 |
/** |
Formats disponibles : Unified diff
Weekly update of contrib modules