Skip to content

Commit

Permalink
[BUGFIX] #160: remove cHash recalculation completely
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitryd committed Sep 13, 2016
1 parent dd4d82f commit d3d163b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
1 change: 0 additions & 1 deletion Classes/Configuration/ConfigurationReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ class ConfigurationReader {
'fileName/defaultToHTMLsuffixOnPrev' => FALSE,
'init/appendMissingSlash' => 'ifNotFile,redirect[301]',
'init/emptySegmentValue' => '',
'init/recalculateChashIfMissing' => false,
'pagePath/spaceCharacter' => '-', // undocumented & deprecated!
);

Expand Down
26 changes: 0 additions & 26 deletions Classes/Decoder/UrlDecoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -870,8 +846,6 @@ protected function doDecoding($path) {
$cacheEntry->setPageId($pageId);
$cacheEntry->setRequestVariables($requestVariables);

$this->calculateChash($cacheEntry);

return $cacheEntry;
}

Expand Down

0 comments on commit d3d163b

Please sign in to comment.