Unverified Commit c7774d21 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3238942 by andypost, alexpott:...

Issue #3238942 by andypost, alexpott: \Drupal\Core\Routing\RedirectDestination::get() causes deprecation errors on PHP 8.1
parent 0bed3aee
Loading
Loading
Loading
Loading
+4 −3
Changes for core/lib/Drupal/Core/Routing/RedirectDestination.php: 4 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -57,11 +57,12 @@ public function getAsArray() {
  public function get() {
    if (!isset($this->destination)) {
      $query = $this->requestStack->getCurrentRequest()->query;
      if (UrlHelper::isExternal($query->get('destination'))) {
      if ($query->has('destination')) {
        $this->destination = $query->get('destination');
        if (UrlHelper::isExternal($this->destination)) {
          // See https://www.drupal.org/node/2454955 for external redirects.
          $this->destination = '/';
        }
      elseif ($query->has('destination')) {
        $this->destination = $query->get('destination');
      }
      else {
        $this->destination = $this->urlGenerator->generateFromRoute('<current>', [], ['query' => UrlHelper::filterQueryParameters($query->all())]);