You are here

function search_autocomplete_form_configure_validate in Search Autocomplete 7.4

Same name and namespace in other branches
  1. 6.4 search_autocomplete.form.configure.inc \search_autocomplete_form_configure_validate()
  2. 7.3 search_autocomplete.form.configure.inc \search_autocomplete_form_configure_validate()

Implements hook_validate().

Save the changes in the database.

File

./search_autocomplete.form.configure.inc, line 271
Search Autocomplete Helper functions to retrieve suggestions from database

Code

function search_autocomplete_form_configure_validate($form, &$form_state) {
  $values = $form_state['values'];
  if ($values['suggestions'] == 1) {
    $new_url = preg_replace('/\\?[^=]*=[^&]*/', '', $values['callback_textfield']);
    if (!drupal_valid_path($new_url)) {
      form_set_error('url', t('callback url is not valid: @new_url', array(
        '@new_url' => $new_url,
      )));
    }
  }
}