You are here

function redirect_get_current_redirect in Redirect 7.2

Same name and namespace in other branches
  1. 7 redirect.module \redirect_get_current_redirect()
1 call to redirect_get_current_redirect()
redirect_init in ./redirect.module
Implements hook_init().

File

./redirect.module, line 195

Code

function redirect_get_current_redirect() {
  $redirect = drupal_static('redirect_set_current_redirect', NULL);

  // If a redirect has not been set with redirect_set_current_redirect(), then
  // attempt to find a redirect matching the current path, query string, and
  // language code.
  if (!isset($redirect)) {
    $redirect = redirect_load_by_source(current_path(), $GLOBALS['language']->language, drupal_get_query_parameters());
  }

  // @todo Add an alter hook here?
  return $redirect;
}