You are here

function path_form_validate in Drupal 5

Same name and namespace in other branches
  1. 4 modules/path.module \path_form_validate()

Verify that a new URL alias is valid

File

modules/path/path.module, line 330
Enables users to rename URLs.

Code

function path_form_validate($form_id, $form_values) {
  $src = $form_values['src'];
  $dst = $form_values['dst'];
  $pid = $form_values['pid'];
  if (db_result(db_query("SELECT COUNT(dst) FROM {url_alias} WHERE pid != %d AND dst = '%s'", $pid, $dst))) {
    form_set_error('dst', t('The alias %alias is already in use.', array(
      '%alias' => $dst,
    )));
  }
}