You are here

function feeds_tamper_str_pad_validate in Feeds Tamper 7

Same name and namespace in other branches
  1. 6 plugins/str_pad.inc \feeds_tamper_str_pad_validate()
1 string reference to 'feeds_tamper_str_pad_validate'
str_pad.inc in plugins/str_pad.inc

File

plugins/str_pad.inc, line 40

Code

function feeds_tamper_str_pad_validate(&$settings) {
  $settings['pad_length'] = trim($settings['pad_length']);
  if (!is_int($settings['pad_length']) && $settings['pad_length'] !== (string) (int) $settings['pad_length']) {
    form_set_error('settings][pad_length', t('Pad length field must be an integer.'));
  }
  else {
    $settings['pad_length'] = (int) $settings['pad_length'];
  }
  if ($settings['pad_string'] === '') {
    $settings['real_pad_string'] = ' ';
  }
  else {
    $settings['real_pad_string'] = $settings['pad_string'];
  }
}