From 02738cc0bca112eb4af67e70e986906d6742cbf1 Mon Sep 17 00:00:00 2001 From: Dmitry Dulepov Date: Tue, 30 Aug 2016 10:29:16 +0300 Subject: [PATCH] [BUGFIX] #160: remove cHash recalculation completely --- Classes/Configuration/ConfigurationReader.php | 1 - Classes/Decoder/UrlDecoder.php | 26 ------------------- 2 files changed, 27 deletions(-) diff --git a/Classes/Configuration/ConfigurationReader.php b/Classes/Configuration/ConfigurationReader.php index 30850904..bbcc782b 100644 --- a/Classes/Configuration/ConfigurationReader.php +++ b/Classes/Configuration/ConfigurationReader.php @@ -87,7 +87,6 @@ class ConfigurationReader { 'fileName/defaultToHTMLsuffixOnPrev' => FALSE, 'init/appendMissingSlash' => 'ifNotFile,redirect[301]', 'init/emptySegmentValue' => '', - 'init/recalculateChashIfMissing' => false, 'pagePath/spaceCharacter' => '-', // undocumented & deprecated! ); diff --git a/Classes/Decoder/UrlDecoder.php b/Classes/Decoder/UrlDecoder.php index de522ac4..2eba54d9 100644 --- a/Classes/Decoder/UrlDecoder.php +++ b/Classes/Decoder/UrlDecoder.php @@ -179,30 +179,6 @@ public function storeCacheRecord() { } } - /** - * Calculates and adds cHash to the entry. This function is only called - * if we had to decode the entry, which was not in the cache. Even if we - * had cHash in the URL, we force to recalculate it because we could have - * decoded parameters differently than the original URL had (for example, - * skipped some noMatch parameters). - * - * @param UrlCacheEntry $cacheEntry - * @return void - */ - protected function calculateChash(UrlCacheEntry $cacheEntry) { - $requestVariables = $cacheEntry->getRequestVariables(); - if (!isset($requestVariables['cHash']) && $this->configuration->get('init/recalculateChashIfMissing')) { - $cacheHashCalculator = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\Page\\CacheHashCalculator'); - /* @var \TYPO3\CMS\Frontend\Page\CacheHashCalculator $cacheHashCalculator */ - $cHashParameters = $cacheHashCalculator->getRelevantParameters(GeneralUtility::implodeArrayForUrl('', $requestVariables)); - - if (count($cHashParameters) > 0) { - $requestVariables['cHash'] = $cacheHashCalculator->calculateCacheHash($cHashParameters); - $cacheEntry->setRequestVariables($requestVariables); - } - } - } - /** * Calls user-defined hooks. * @@ -870,8 +846,6 @@ protected function doDecoding($path) { $cacheEntry->setPageId($pageId); $cacheEntry->setRequestVariables($requestVariables); - $this->calculateChash($cacheEntry); - return $cacheEntry; }