Issue Bug Closed

#17095Typolink : cHash isn't created if there's no additionalParams

Popy no-lastname-given 03/08/07, 09:34 updated 03/29/11, 14:22

Description

If the typolink is configured without additionalParams and without addQueryString, the cHash is not generated, even if we need it because of linkVars

File class.tslib_content.php, line 5219 :

if (substr($addQueryParams,0,1)!=’&’) {
$addQueryParams = ‘’;
} elseif ($conf[‘useCacheHash’]) {
$pA = t3lib_div::cHashParams($GLOBALS[‘TSFE’]->linkVars.$addQueryParams);
$addQueryParams.= ‘&cHash=’.t3lib_div::shortMD5(serialize($pA));
}

I propose this patch :

if (substr($addQueryParams,0,1)!=’&’) {
$addQueryParams = ‘’;
}
if ($conf[‘useCacheHash’] && trim($GLOBALS[‘TSFE’]->linkVars.$addQueryParams)) {
$pA = t3lib_div::cHashParams($GLOBALS[‘TSFE’]->linkVars.$addQueryParams);
$addQueryParams.= ‘&cHash=’.t3lib_div::shortMD5(serialize($pA));
}

(issue imported from #M5161)

Reviews 0

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