typolink: cHash corrupted due to linkVars
I've found an error in function typolink of class.tslib_content.php
Line 5222 :
$pA = t3lib_div::cHashParams($addQueryParams.$GLOBALS['TSFE']->linkVars);
Here linkvars are appended to additionalParams, wich is wrong, because when the url is build (in class.tstemplate.php, function linkData, line 1382), linkVars are prepended (that allows additionalParams to ovveride linkVars).
Also when a typolink tries to override a linkVar, the cHash is always wrong!
Example : overriding L parameter from value 1 to value 2 :
cHash is calculated for &L=2&L=1, but the final link will be &L=1&L=2
Also I propose to replace the line 5222 (in class.tslib_content.php)
by this :
cHash is not calculated by menus (HMENU cObjects), and putting cHash value in linkVars is not a good solution because cHash will not be valid if current url contains a parameter wich will not be saved by linkVars
Maybe cHash should be generated in the function linkData? Or menu should use typolink instead of linkdata?
(issue imported from #M5117)
#9 Updated by Chris topher over 9 years ago
@ Popy: A solution to the problem surely should be integrated!
It would be great, if you could update the patch!
Please post it to Core List afterwards. See http://typo3.org/teams/core/core-mailinglist-rules/
#13 Updated by mitja doma over 9 years ago
I can confirm this bug also in typo3core svn trunk (rev 7129).
In my case it resulted in a huge realurl encodecache table where identical urls (e.g. id=2&L=3) had many different (up to 10) cHash values - all stored in the encode cache table.
applying the patch seems to have solved this bit,
there are no more 'duplicate' cHashes in the encode cache table anymore.