Bug #17070
closedtypolink: cHash corrupted due to linkVars
0%
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)
Files
Updated by Oliver Hader over 17 years ago
I can confirm this and agree that linkVars and additionalParams have to be swapped. My patch concerning cHash in linkVars at bug-id #17002 does the same.
This behaviour also exists in TYPO3 4.1RC2.
Updated by Popy no-lastname-given over 17 years ago
Not really the same : I need the cHash to be correctly generated by typolink. in some cases Links should not contain a cHash, that's why cHash should not be automatically created.
The error is still present in 4.1RC2.
Updated by Oliver Hader over 17 years ago
Sorry, I tried to say "covers/contains the same problem in class.tslib_content.php". I attached a file which changes the order of linkVars and additionalParams.
Updated by Sareen Millet over 17 years ago
This Patch really seams to solve the above Problem. But if you set $TYPO3_CONF_VARS['FE']['pageNotFoundOnCHashError'] = 1 you will notice that after overriding L parameter from value 1 to value 0 the generated cHash is still wrong.
Updated by Popy no-lastname-given over 17 years ago
This is another problem : see related bug #17095
Updated by Michael Stucki over 17 years ago
This is not really a duplicate, but exactly this fix is already contained in Olivers patch in #17002. So I assume it will be fixed shortly.
Updated by Popy no-lastname-given over 17 years ago
Bug still present in typo3 v 4.1.2 (and #17095 too !)
Updated by Popy no-lastname-given over 14 years ago
Reminder : Bug still present in latests releases (v4.1, 4.2, 4.3).
I can build new pacth file if needed and if it has a chance to be taken in account.
Updated by Chris topher over 14 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/
Updated by Popy no-lastname-given over 14 years ago
patch updated for trunk version and 4.3 + 4.2 versions
Updated by Andreas Kießling over 14 years ago
I guess 4.2 won't work. There is no function "generateCHash" in t3lib_div?
Updated by Popy no-lastname-given over 14 years ago
Popy failed at "Copy paste"
New patch
Updated by mitja doma over 14 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.
Updated by Dmitry Dulepov over 14 years ago
(minor edit of the report to adjust punctuation for better reading)
Updated by Dmitry Dulepov over 14 years ago
The part in the "Additional Information" is obsolete by now because meny uses typoLink since TYPO3 4.2. The rest remains actual.
Updated by Dmitry Dulepov over 14 years ago
4.2, 4.3 and 4.4. Revisions: 7864, 7863 and 7862 correspondingly.
Updated by Popy no-lastname-given about 14 years ago
Sorry, wasn't looking the good svn repository...
Updated by Popy no-lastname-given almost 14 years ago
y of course, sorry for that :/