Bug #18032
closedusing addQueryString couses wrong cHash on pages with no query string
0%
Description
After moving site to new server I've find out that some pages does not getting cached anymore though on previous server they does. Then I traced it to next:
- lets say you use typolink function with addQueryString and additionalParams properties set
- then the conf getting processed in class.tslib_content.php::typoLink
- there is a call to class.tslib_content.php::getQueryArguments, BUT if the current page has no query string then you got only '&' string out of the method
- and after this it is glued with additionalParams string so you get string like this '&¶m=value...'
- then it is passed to t3lib_div::cHashParams and becouse of double ampersands we get one empty key with empty value in result array
- and then it is passed to t3lib_div::shortMD5(serialize(...))
- and then we GOT WRONG cHash because that '&&' coused an empty key/value in cHashParams array
looks like PHP ver 4.4.7 that I got on new server serializes that empty value in array and an old version does not so the bug revealed only after moving
PHP version 4.4.7
(issue imported from #M7230)
Files
Updated by Vladimir Podkovanov almost 17 years ago
UPDATE: the bug clearly seen only with realurl installed as without it query string always exists (as page id)
Updated by Benni Mack over 16 years ago
Hey, do you want to send this patch to the core list?
Updated by Dmitry Dulepov over 16 years ago
The problem is fixed in 4.2 and trunk. Current code is:
$queryString = t3lib_div::getIndpEnv('QUERY_STRING'); // shortcut (no further processing necessary) if (!$conf['exclude']) { return $queryString ? '&'.$queryString : ''; }