function backup_migrate_unsigned_integer_validate in Backup and Migrate 7.3
Validate fields that require zero or a positive integer.
2 string references to 'backup_migrate_unsigned_integer_validate'
- backup_migrate_ui_advanced_settings_form in ./
backup_migrate.advanced_settings.inc - The advanced settings form.
- BmTestBasics::testFieldValidators in tests/
BmTestBasics.test - Test the custom validators.
File
- ./
backup_migrate.advanced_settings.inc, line 169 - Functionality required for the advanced settings form.
Code
function backup_migrate_unsigned_integer_validate($element, &$form_state, $form) {
$value = $element['#value'];
$test = preg_match('/^[0-9]+$/', $value);
if ($test !== 1) {
form_error($element, t('%name must be zero or a positive integer.', array(
'%name' => $element['#title'],
)));
}
}