function feeds_tamper_math_validate in Feeds Tamper 7
Same name and namespace in other branches
- 6 plugins/math.inc \feeds_tamper_math_validate()
File
- plugins/
math.inc, line 67
Code
function feeds_tamper_math_validate(&$settings) {
if (!is_numeric($settings['value'])) {
form_set_error('settings][value', t('The value must be numeric.'));
}
elseif ($settings['operation'] === 'division' && empty($settings['flip']) && $settings['value'] == 0) {
form_set_error('settings][value', t('Cannot divide by zero.'));
}
}