Skip to content
Snippets Groups Projects
Commit 1fd78d5d authored by Oliver Hader's avatar Oliver Hader Committed by Stefan Bürk
Browse files

[BUGFIX] Avoid disabling page caches when having cHash validation enforced

If $GLOBALS['TYPO3_CONF_VARS']['FE']['cacheHash']['enforceValidation']
is enabled and the HTTP request only contains the `?id` query parameter,
caching for the page is disabled - which should be avoided.

Resolves: #99859
Releases: main, 11.5, 10.4
Change-Id: I14a81f5a2ec3ecabedd1abf0756a3ee32e7af4e4
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77728


Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
parent aa057bfc
No related merge requests found
......@@ -201,9 +201,14 @@ class PageArgumentValidator implements MiddlewareInterface, LoggerAwareInterface
return $this->evaluateQueryParametersWithoutCacheHash($pageArguments->getDynamicArguments(), $pageNotFoundOnCacheHashError);
}
$relevantParameters = $this->getRelevantParametersForCacheHashCalculation($pageArguments);
// There are no parameters that require a cHash.
// We end up here when the site was called with an `id` param, e.g. https://example.org/index?id=123.
if (empty($relevantParameters)) {
return true;
}
// There are parameters that would be needed for the current page, but no cHash is given.
// Thus, a "page not found" error is thrown - as configured via "pageNotFoundOnCHashError".
if (!empty($relevantParameters) && $pageNotFoundOnCacheHashError) {
if ($pageNotFoundOnCacheHashError) {
return false;
}
// Caching is disabled now (but no 404)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment