Example #1
0
 /**
  * Helper function to find recursive redirects.
  *
  * @param \Drupal\redirect\Entity\Redirect
  *   The redirect object.
  * @param string $language
  *   The language to use.
  */
 protected function findByRedirect(Redirect $redirect, $language)
 {
     $uri = $redirect->getRedirectUrl();
     $baseUrl = \Drupal::request()->getBaseUrl();
     $path = ltrim(substr($uri->toString(), strlen($baseUrl)), '/');
     $query = $uri->getOption('query') ?: [];
     return $this->findMatchingRedirect($path, $query, $language);
 }