You are here

function varnish_admin_settings_form_validate in Varnish 6

Same name and namespace in other branches
  1. 7 varnish.admin.inc \varnish_admin_settings_form_validate()

File

./varnish.admin.inc, line 108
varnish.admin.inc

Code

function varnish_admin_settings_form_validate($form, &$form_state) {
  if (!is_numeric($form_state['values']['varnish_socket_timeout']) || $form_state['values']['varnish_socket_timeout'] < 0) {
    form_set_error('varnish_socket_timeout', t('Varnish connection timeout must be a positive number.'));
  }
  else {
    $form_state['values']['varnish_socket_timeout'] = (int) $form_state['values']['varnish_socket_timeout'];
  }
}