Bug #81293
closedcacheHash fails to be generated because of missing id although id is present in request-string
100%
Description
An error #1467983513: ID parameter needs to be passed for the cHash calculation! is thrown in certain cases although id is present in GET-query (see screenshot for example).
Reason: In sysext/extbase/Classes/Mvc/Web/CacheHashEnforcer.php->enforceForRequest() on line 66 this function is called:
$this->cacheHashCalculator->getRelevantParameters( http_build_query($parameters) )
http_build_query() builds the query using the urlencoded & instead of a simple "&". The query-string is then passed to sysext/frontend/Classes/Page/CacheHashCalculator.php->splitQueryStringToArray() which uses an simple & to explode the parameters again: explode('&', ...) and convert them back to an associative array:
$parameters = array_filter(explode('&', ltrim($queryString, '?')));
This leads to an error, because the id-parameter can not be extracted correctly in some cases.
To solve the problem, the line in sysext/extbase/Classes/Mvc/Web/CacheHashEnforcer.php->enforceForRequest() needs to be corrected to:
$this->cacheHashCalculator->getRelevantParameters( http_build_query($parameters, '', '&') )
Files
Updated by Markus Klein almost 7 years ago
- Related to Bug #78002: Require cHash for cached plugin actions in Extbase added
Updated by Markus Klein almost 7 years ago
- Status changed from New to Accepted
- Is Regression set to Yes
Updated by Markus Klein almost 7 years ago
A question though:
Are you sure about the
&thing? Because this is not URL-encoded, but HTML-encoded.
http_build_query
is documented to return URL-encoded strings.Updated by Markus Klein almost 7 years ago
- Status changed from Accepted to Needs Feedback
- Priority changed from Must have to -- undefined --
- Target version deleted (
Candidate for patchlevel) - Is Regression deleted (
Yes)
@David: I double-checked the code now and it seems rather correct. Please explain where your & chars come from.
Updated by Carsten Falkenberg almost 7 years ago
- File exception.jpg exception.jpg added
I experienced the same issue, after submitting a form. removed all third-party extensions, except my distribution.
PHP 7.0.19
TYPO3 8.7.1
Updated by Helmut Hummel almost 7 years ago
Could it be that you both have arg-separator.output
set to &
in your php.ini?
Updated by Carsten Falkenberg almost 7 years ago
that is correct. arg_separator.output is set to &
on that server.
changing the value to &
solved the problem.
Updated by Gerrit Code Review almost 7 years ago
- Status changed from Needs Feedback to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52922
Updated by Gerrit Code Review almost 7 years ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/52923
Updated by Markus Klein almost 7 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 82aa414102978a47a2f8fb0d8b98b2dbe38e41a4.
Updated by Markus Klein almost 7 years ago
- Related to Task #81366: Make sure all http_build_query() calls use a defined separator added
Updated by Markus Klein almost 7 years ago
- Has duplicate Bug #81565: ID parameter needs to be passed for the cHash calculation! added