You are here

function restclient_admin_settings_validate in RESTClient 7.2

Validation callback

1 string reference to 'restclient_admin_settings_validate'
restclient_admin_settings in ./restclient.admin.inc
Administration form for restclient module

File

./restclient.admin.inc, line 104
Administration pages for restclient module

Code

function restclient_admin_settings_validate($form, &$form_state) {
  $values = $form_state['values'];

  // Check for hostname
  // @todo change to valid_url function
  // @see api.drupal.org
  if (!filter_var($values['restclient_hostname'], FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED)) {
    form_set_error('restclient_hostname', t('Invalid URL'));
  }
}