Skip to content

Commit

Permalink
Fix absolute urls that were broken by our custom Router
Browse files Browse the repository at this point in the history
  • Loading branch information
jolelievre committed Nov 19, 2024
1 parent 94c17e8 commit 694f710
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/PrestaShopBundle/Service/Routing/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@ public static function generateTokenizedUrl($url, $token)
$url .= '#' . strtr(rawurlencode($components['fragment']), ['%2F' => '/', '%3F' => '?']);
}

// Keep absolute urls absolute
if (!empty($components['scheme']) && !empty($components['host'])) {
$baseHost = $components['scheme'] . '://' . $components['host'];
$url = $baseHost . $url;
}

return $url;
}

Expand Down

0 comments on commit 694f710

Please sign in to comment.