Issue Bug Closed

#102727CanonicalizationUtility does not remove unknown parameters

Moritz Karbaum 12/29/23, 13:55 updated 04/18/25, 10:24

Description

In TYPO3 11 (and 10), when I request a page with some random parameter, it will be kept in the canonical URL:

I open this URL https://project.ddev.site/some/page/?test=1 and will get a page with the canonical URL https://project.ddev.site/some/page/?test=1&cHash=cd723811a5eabde4293bd326995d91e1

Since test is not a TYPO3 core parameter and was also not added to $GLOBALS['TYPO3_CONF_VARS']['FE']['additionalCanonicalizedUrlParameters'] I would expect it to be dropped from the canonical URL.

As it stands currently, the first request will create the canonical URL with whatever parameters, and all further requests will receive the cached page with the wrong canonical URL.

As far as I can tell, TYPO3\CMS\Frontend\Utility\CanonicalizationUtility is comparing parameters relevant for cHash calculation with the URL parameters – which always match.

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.