Project

General

Profile

Actions

Bug #17070

closed

typolink: cHash corrupted due to linkVars

Added by Popy no-lastname-given about 17 years ago. Updated over 13 years ago.

Status:
Closed
Priority:
Should have
Category:
Communication
Target version:
-
Start date:
2007-03-02
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.0
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

0005117.patch (1.36 KB) 0005117.patch Administrator Admin, 2007-03-04 13:12
tslib_content.diff (2.21 KB) tslib_content.diff Administrator Admin, 2007-08-02 15:20
tslib_content.trunk.patch (1.18 KB) tslib_content.trunk.patch Administrator Admin, 2010-05-20 15:41
tslib_content.v43.patch (1.18 KB) tslib_content.v43.patch Administrator Admin, 2010-05-20 15:42
tslib_content.v42.patch (1.58 KB) tslib_content.v42.patch Administrator Admin, 2010-05-20 15:42
tslib_content.v42.fixed.patch (1.89 KB) tslib_content.v42.fixed.patch Administrator Admin, 2010-05-21 10:37
5117_4-4.diff (1.39 KB) 5117_4-4.diff Administrator Admin, 2010-06-02 14:25

Related issues 4 (0 open4 closed)

Related to TYPO3 Core - Bug #17095: Typolink : cHash isn't created if there's no additionalParamsClosed2007-03-08

Actions
Related to TYPO3 Core - Bug #22788: Make sure that cHash is the same regardless of parameter orderClosed2010-06-02

Actions
Related to TYPO3 Core - Bug #19003: double cache or no cache through cHash variants of the same URLClosed2008-06-23

Actions
Is duplicate of TYPO3 Core - Bug #17002: cHash is not recreated on disposal in config.linkVarsClosed2007-02-17

Actions
Actions #1

Updated by Oliver Hader about 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.

Actions #2

Updated by Popy no-lastname-given about 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.

Actions #3

Updated by Oliver Hader about 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.

Actions #4

Updated by Sareen Millet almost 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.

Actions #5

Updated by Popy no-lastname-given almost 17 years ago

This is another problem : see related bug #17095

Actions #6

Updated by Michael Stucki almost 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.

Actions #7

Updated by Popy no-lastname-given over 16 years ago

Bug still present in typo3 v 4.1.2 (and #17095 too !)

Actions #8

Updated by Popy no-lastname-given about 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.

Actions #9

Updated by Chris topher almost 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/

Actions #10

Updated by Popy no-lastname-given almost 14 years ago

patch updated for trunk version and 4.3 + 4.2 versions

Actions #11

Updated by Andreas Kiessling almost 14 years ago

I guess 4.2 won't work. There is no function "generateCHash" in t3lib_div?

Actions #12

Updated by Popy no-lastname-given almost 14 years ago

Popy failed at "Copy paste"

New patch

Actions #13

Updated by mitja doma almost 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.

Actions #14

Updated by Dmitry Dulepov almost 14 years ago

(minor edit of the report to adjust punctuation for better reading)

Actions #15

Updated by Dmitry Dulepov almost 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.

Actions #16

Updated by Dmitry Dulepov almost 14 years ago

4.2, 4.3 and 4.4. Revisions: 7864, 7863 and 7862 correspondingly.

Actions #17

Updated by Popy no-lastname-given over 13 years ago

Bug remain in trunk

Actions #18

Updated by Popy no-lastname-given over 13 years ago

Sorry, wasn't looking the good svn repository...

Actions #19

Updated by Francois Suter over 13 years ago

Popy, so can we close it again?

Actions #20

Updated by Popy no-lastname-given over 13 years ago

y of course, sorry for that :/

Actions #21

Updated by Francois Suter over 13 years ago

Closed again.

Actions

Also available in: Atom PDF