1 redirect.module redirect_hash(Redirect $redirect)

Create a redirect hash.

A unique hash based on source, source_options, and language.

Parameters

Redirect entity.: The Redirect entity for which the hash should be generated.

Return value

string the redirect hash.:

File

core/modules/redirect/redirect.module, line 978

Code

function redirect_hash(Redirect $redirect) {
  $hash = array(
    'source' => $redirect->source,
    'langcode' => $redirect->langcode,
  );
  if (!empty($redirect->source_options['query'])) {
    $hash['source_query'] = $redirect->source_options['query'];
  }
  backdrop_alter('redirect_hash', $hash, $redirect);
  redirect_sort_recursive($hash, 'ksort');
  $redirect->hash = backdrop_hash_base64(serialize($hash));
  return $redirect->hash;
}