Index: t3lib/class.t3lib_div.php =================================================================== --- t3lib/class.t3lib_div.php (revision 5883) +++ t3lib/class.t3lib_div.php (working copy) @@ -4260,7 +4260,7 @@ * * @param string Query-parameters: "&xxx=yyy&zzz=uuu" * @return array Array with key/value pairs of query-parameters WITHOUT a certain list of variable names (like id, type, no_cache etc.) and WITH a variable, encryptionKey, specific for this server/installation - * @see tslib_fe::makeCacheHash(), tslib_cObj::typoLink() + * @see tslib_fe::makeCacheHash(), tslib_cObj::typoLink(), t3lib_div::calculateCHash() */ public static function cHashParams($addQueryParams) { $params = explode('&',substr($addQueryParams,1)); // Splitting parameters up @@ -4296,6 +4296,30 @@ } /** + * Returns the cHash based on provided query parameters and added values from internal call + * + * @param string Query-parameters: "&xxx=yyy&zzz=uuu" + * @return string Hash of all the values + * @see t3lib_div::cHashParams(), t3lib_div::calculateCHash() + */ + public static function generateCHash($addQueryParams) { + $cHashParams = t3lib_div::cHashParams($addQueryParams); + $cHash = t3lib_div::calculateCHash($cHashParams); + return $cHash; + } + + /** + * Calculates the cHash based on the provided parameters + * + * @param array Array of key-value pairs + * @return string Hash of all the values + */ + public static function calculateCHash($params) { + $cHash = md5(serialize($params)); + return $cHash; + } + + /** * Responds on input localization setting value whether the page it comes from should be hidden if no translation exists or not. * * @param integer Value from "l18n_cfg" field of a page record Index: typo3/sysext/cms/tslib/class.tslib_fe.php =================================================================== --- typo3/sysext/cms/tslib/class.tslib_fe.php (revision 5883) +++ typo3/sysext/cms/tslib/class.tslib_fe.php (working copy) @@ -1741,7 +1741,7 @@ $GET = t3lib_div::_GET(); if ($this->cHash && is_array($GET)) { $this->cHash_array = t3lib_div::cHashParams(t3lib_div::implodeArrayForUrl('',$GET)); - $cHash_calc = t3lib_div::shortMD5(serialize($this->cHash_array)); + $cHash_calc = t3lib_div::calculateCHash($this->cHash_array); if ($cHash_calc!=$this->cHash) { if ($this->TYPO3_CONF_VARS['FE']['pageNotFoundOnCHashError']) { Index: typo3/sysext/cms/tslib/class.tslib_content.php =================================================================== --- typo3/sysext/cms/tslib/class.tslib_content.php (revision 5883) +++ typo3/sysext/cms/tslib/class.tslib_content.php (working copy) @@ -5971,8 +5971,8 @@ if (substr($addQueryParams,0,1)!='&') { $addQueryParams = ''; } elseif ($conf['useCacheHash']) { // cache hashing: - $pA = t3lib_div::cHashParams($addQueryParams.$GLOBALS['TSFE']->linkVars); // Added '.$this->linkVars' dec 2003: The need for adding the linkVars is that they will be included in the link, but not the cHash. Thus the linkVars will always be the problem that prevents the cHash from working. I cannot see what negative implications in terms of incompatibilities this could bring, but for now I hope there are none. So here we go... (- kasper) - $addQueryParams.= '&cHash='.t3lib_div::shortMD5(serialize($pA)); + // Added '.$this->linkVars' dec 2003: The need for adding the linkVars is that they will be included in the link, but not the cHash. Thus the linkVars will always be the problem that prevents the cHash from working. I cannot see what negative implications in terms of incompatibilities this could bring, but for now I hope there are none. So here we go... (- kasper); + $addQueryParams .= '&cHash=' . t3lib_div::generateCHash($addQueryParams . $GLOBALS['TSFE']->linkVars); } $tCR_domain = ''; Index: typo3/sysext/indexed_search/class.indexer.php =================================================================== --- typo3/sysext/indexed_search/class.indexer.php (revision 5883) +++ typo3/sysext/indexed_search/class.indexer.php (working copy) @@ -331,7 +331,7 @@ $this->conf['gr_list'] = '0,-1'; // Group list (hardcoded for now...) // cHash values: - $this->conf['cHash'] = $createCHash ? $this->makeCHash($cHash_array) : ''; // cHash string for additional parameters + $this->conf['cHash'] = $createCHash ? t3lib_div::generateCHash(t3lib_div::implodeArrayForUrl('', $cHash_array)) : ''; // cHash string for additional parameters $this->conf['cHash_array'] = $cHash_array; // Array of the additional parameters // Set to defaults @@ -1995,6 +1995,7 @@ * * @param array Array of GET parameters to encode * @return void + * @deprecated since TYPO3 4.3 - use directly t3lib_div::calculateCHash() */ function makeCHash($paramArray) { $addQueryParams = t3lib_div::implodeArrayForUrl('', $paramArray);