Issue Bug Closed

#17070typolink: cHash corrupted due to linkVars

Popy no-lastname-given 03/02/07, 17:29 updated 11/26/10, 14:43

Description

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)
$pA=t3lib_div::cHashParams($addQueryParams.$GLOBALS[‘TSFE’]->linkVars);

by this :
$pA=t3lib_div::cHashParams($GLOBALS[‘TSFE’]->linkVars.$addQueryParams);

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)

Reviews 0

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