You are here

function nodewords_base_url_validate in Nodewords: D6 Meta Tags 6

Function to validate the base URL.

1 string reference to 'nodewords_base_url_validate'
nodewords_settings_form in ./nodewords.admin.inc
Menu callback: settings form.

File

./nodewords.admin.inc, line 367
Administration interface for nodewords.module.

Code

function nodewords_base_url_validate($element, &$form_state) {
  if (!empty($element['#value']) && !($base_url = rtrim($element['#value'], '/'))) {
    form_error($element, t('Invalid base URL.'));
  }
  elseif (!empty($base_url) && !valid_url($base_url, TRUE)) {
    form_error($element, t('Invalid base URL.'));
  }
}