Fix for Fix for Potential patch for path_redirect v5.x-1.x-dev to avoid infinite loops (v2)

  1.   // check that there is no potential for an infinte loop
  2.   $result = db_query("SELECT * FROM {url_alias} u WHERE src = '%s' AND dst = '%s'", $form_values['redirect'], $form_values['path']);
  3.   if (db_fetch_object($result)) {
  4.     form_set_error('path', t('The path you have created already exists as a URL alias, which will cause the site to loop back and forth between the two indefinitely.'));
  5.   }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.