[TYPO3-english] unwanted cHash is generated in 50% links from USER_INT plugin

Dmitry Martynenko dima at realt.by
Tue Oct 21 18:10:10 CEST 2008


Hi Dmitry,

I have look into TYPO3 Core and RealURL code and investigated
following things.

cHash can be added to URLs in two places:
1. In tslib_cObj class function typoLink()
2. In RealURL extension in function decodeSpURL_doDecode()

I logged typoLink() and it is working fine!

Then I looked in RealURL.
Function decodeSpURL_doDecode() get cHash value using decodeSpURL_cHashCache()
from tx_realurl_chashcache table and add it to URL if it exists.

I think my problem is in decodeSpURL_cHashCache(), which gets
existent cHash value for URLs that should not to have cHash.

May be field spurl_hash in tx_realurl_chashcache table has type
INTEGER and thus has "duplicates" for different url?

But manualy clearing tables tx_realurl_chashcache,
tx_realurl_urldecodecache and tx_realurl_urlencodecache I solved my
problem! There is no more cHash value appears in URLs from our USER_INT plugin!

To Dmitry Dulepov :)

May be you can to do you comment in decodeSpURL_cHashCache()
// TODO Dima: should be changed to normal md5 too?

And also add clearing of tx_realurl_chashcache table to
clearPageCacheMgm() function?

>>> Links are generated from *one place* in plugin using this function call:
>>> 
>>> $this->singlePageId = $GLOBALS["TSFE"]->id;
>>> $linkText = 'link text...';
>>> $urlParameters = array('unid' => $rowData['code'], 'photo' => 1);
>>> $link = $this->pi_linkTP($linkText, $urlParameters, 1, $this->singlePageId.' _blank');

DD>> If you want to get rid of cHash I suggest to check what the third parameter to pi_linkTP means ;)

DM> I try to set third parameter $cache to 0, but it is not solved problem.
DM> Link with cHash and without it are generated:

DM> sale/cottages/object/1005255/photo/
DM> ?id=75&unid=1005255&photo=1&cHash=610751bf45  12-10-08 12:12 / 3 min
DM> sale/cottages/object/33682/photo/ ?id=75&unid=33682&photo=1  12-10-08 12:11 / 3 min
DM> sale/cottages/object/4716/photo/
DM> ?id=75&unid=4716&photo=1&cHash=65d4e65859  12-10-08 12:14 / 1 min 
DM> sale/cottages/object/49700/photo/
DM> ?id=75&unid=49700&photo=1&cHash=dd8523e637  12-10-08 12:14 / 1 min 
DM> sale/cottages/object/68384/photo/ ?id=75&unid=68384&photo=1  12-10-08 12:13 / 1 min
DM> sale/cottages/object/76602/photo/ ?id=75&unid=76602&photo=1  12-10-08 12:13 / 2 min
DM> sale/cottages/object/77264/photo/ ?id=75&unid=77264&photo=1  12-10-08 12:12 / 2 min
DM> sale/cottages/object/80408/ ?id=75&unid=80408&cHash=dd540a83f3

DM> Can I hook something to see normal url in form "?id=75&..." after call to pi_linkTP ?
DM> Thus I'll can log urls to locate when cHash is added.

-- 
Dmitry Martynenko
Developer

Web: http://realt.by



More information about the TYPO3-english mailing list