Skip to content
Snippets Groups Projects
user avatar
Stefan Bürk authored
With #89091 pages with slugs containing trailing slash have
been enabled to be resolved when requested with trailing
slash in the request uri and have been a logical follow-up
of #86055.

In between an issue with language fallback chain have been
found, which allowed that a valid translated page could be
resolved with the default language slug even and reported
as #88715 and #96010. These issues have been solved with
https://review.typo3.org/c/Packages/TYPO3.CMS/+/75101 which
partly broke the original implemented behaviour for pages
with trailing slash slugs requested without a trailing slash.

This change now ensures pages are resolved containing a trailing
slash in their "slug" like "/my-page/subpage/" if requested without
the trailing slash like "https://domain.tld/my-page/subpage".

Additionally, tests are added to cover this case along with
other possible cases. This should detect future regressions.

The docblock return annotation for `PageRouter::matchRequest()` is
changed to the correct returned value, removing ignore pattern for
the phpstan baseline instead of increasing the counter.

Note: This change ensures that a page can be resolved in any
      constellation with trailing slash in record slug/not
      in record slug and requested with trailing slash/not
      requested slug. In both cases, already working and the
      now fixed variant are serving both potential duplicate
      content - if no correct cannonical url is provided.

Tackling the duplicate issue should be done in a dedicated
change for both cases.

Used command(s):

> Build/Scripts/runTests.sh -s phpstanGenerateBaseline

Resolves: #100990
Related: #96010
Related: #88715
Related: #89091
Related: #86055
Releases: main, 12.4, 11.5
Change-Id: I9f26c4500e2f812e8727b4b565570fcc579bf3e6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79249


Tested-by: default avatarOliver Klee <typo3-coding@oliverklee.de>
Tested-by: default avatarNikita Hovratov <nikita.h@live.de>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarNikita Hovratov <nikita.h@live.de>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarcore-ci <typo3@b13.com>
0078b7c7
Name Last commit Last update