diff --git a/Classes/Utility/UrlUtility.php b/Classes/Utility/UrlUtility.php index 5a9af18d..8bb30a2f 100644 --- a/Classes/Utility/UrlUtility.php +++ b/Classes/Utility/UrlUtility.php @@ -120,11 +120,6 @@ public function getFrontendUrlWithSite($url, SiteInterface $site, string $return $targetUri = $targetUri->withScheme($frontendBase->getScheme()); } - if ($targetUri->getFragment() !== '') { - $targetUri = $targetUri->withHost(''); - $targetUri = $targetUri->withScheme(''); - } - if ($frontExtraPath) { $targetUri = $targetUri->withPath($this->handleFrontendAndBackendPaths($frontExtraPath, $targetUri, $site->getBase()->getPath())); } diff --git a/Tests/Unit/Utility/UrlUtilityTest.php b/Tests/Unit/Utility/UrlUtilityTest.php index 9800cabd..7177293a 100644 --- a/Tests/Unit/Utility/UrlUtilityTest.php +++ b/Tests/Unit/Utility/UrlUtilityTest.php @@ -133,6 +133,7 @@ public function testFrontendUrls(): void self::assertSame('https://test-frontend3.tld/sitemap', $urlUtility->resolveKey('SpecialSitemapKey')); self::assertSame('https://test-frontend-api3.tld/headless', $urlUtility->getFrontendUrlWithSite('https://test-backend3-api.tld', $site->reveal(), 'frontendApiProxy')); self::assertSame('#fragment-123', $urlUtility->getFrontendUrlWithSite('#fragment-123', $site->reveal())); + self::assertSame('https://test-frontend3.tld/test-page#section', $urlUtility->getFrontendUrlWithSite('https://test-backend-api.tld/test-page#section', $site->reveal())); } public function testFrontendUrlsWithDifferentPaths(): void