From 8e6a09e7c60d84661826cdcfdc1a3cd06ecd1dfe Mon Sep 17 00:00:00 2001 From: Popy Date: Thu, 21 Jul 2011 17:04:02 +0200 Subject: [PATCH] [FEATURE] Generate cHash only if needed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit tslib_cObj->typolink() generates cHash in every case, even if not needed. Change the behavior to generate cHash only if necessary. Change-Id: Id6a015e6bd89e9baeafd9532d4a21018adf91691 Resolves: #28352 Releases: 4.6 Reviewed-on: http://review.typo3.org/3456 Reviewed-by: Dmitry Dulepov Tested-by: Dmitry Dulepov Tested-by: Popy Reviewed-by: Xavier Perseguers Reviewed-by: Stefan Neufeind Reviewed-by: Benjamin Mack Reviewed-by: Björn Pedersen Tested-by: Xavier Perseguers --- typo3/sysext/cms/tslib/class.tslib_content.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/typo3/sysext/cms/tslib/class.tslib_content.php b/typo3/sysext/cms/tslib/class.tslib_content.php index ed71890d1082..90afe9e85b2c 100644 --- a/typo3/sysext/cms/tslib/class.tslib_content.php +++ b/typo3/sysext/cms/tslib/class.tslib_content.php @@ -5687,7 +5687,11 @@ class tslib_cObj { // Mind the order below! See http://bugs.typo3.org/view.php?id=5117 $params = $GLOBALS['TSFE']->linkVars . $addQueryParams; if (trim($params, '& ') != '') { - $addQueryParams .= '&cHash=' . t3lib_div::generateCHash($params); + $cHashParams = t3lib_div::cHashParams($addQueryParams); + if (count($cHashParams) > 1) { + $addQueryParams .= '&cHash=' . t3lib_div::calculateCHash($cHashParams); + } + unset($cHashParams); } unset($params); } -- 2.20.1