Skip to content

[6.x] Fix site URLs configured with Antlers being treated as external - #15250

Open
duncanmcclean wants to merge 1 commit into
6.xfrom
resolved-site-urls
Open

[6.x] Fix site URLs configured with Antlers being treated as external#15250
duncanmcclean wants to merge 1 commit into
6.xfrom
resolved-site-urls

Conversation

@duncanmcclean

Copy link
Copy Markdown
Member

This pull request fixes an issue where URLs on a site's own host were left untouched by URL::tidy() when the site's URL is configured with Antlers, keeping trailing slashes on permalinks, canonical URLs, sitemap entries, etc. This mostly affects headless setups, where the site URLs (eg. {{ config:app:frontend_url }}/fr) point at a different host than APP_URL.

This was happening because URL::ensureSiteCaches() built its list of known site hosts from rawConfig()['url'] — the unresolved config value. An Antlers value like {{ config:app:frontend_url }}/fr isn't an absolute URL, so it was filtered out of the list and the site's host was never recognised as belonging to the application. Single-host setups were unaffected because the host also matches config('app.url'), which is checked separately.

This PR fixes it by building the site caches from $site->url() — the resolved config value the Site object has already computed by that point, so there's no extra parsing involved.

Fixes #15232

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Headless site URLs are treated as external in URL::tidy()

1 participant