Skip to content

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

Merged
jasonvarga merged 1 commit into
6.xfrom
resolved-site-urls
Aug 26, 2026
Merged

[6.x] Fix site URLs configured with Antlers being treated as external#15250
jasonvarga merged 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

@jasonvarga

Copy link
Copy Markdown
Member

The usage of $site->rawConfig()['url'] looked intentional to me. But I can't find a reason for why, and AI tried to test for recursion or performance issues and it found nothing either.

@jasonvarga
jasonvarga merged commit 8de504c into 6.x Aug 26, 2026
65 checks passed
@jasonvarga
jasonvarga deleted the resolved-site-urls branch August 26, 2026 16:44
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()

2 participants