[BUGFIX] Exception with cHashIncludePageId but no id in the URL 98/50198/2
authorDmitry Dulepov <dmitry.dulepov@gmail.com>
Tue, 27 Sep 2016 11:13:23 +0000 (14:13 +0300)
committerHelmut Hummel <typo3@helhum.io>
Wed, 12 Oct 2016 18:29:21 +0000 (20:29 +0200)
If the 'id' parameter is not provided in the URL but the
FE|cHashIncludePageId is set to true, TYPO3 will throw an exception. If
id is missing in $_GET, TYPO3 should use the determined id for the
check because in such case the id is assumed to be the uid of the home
page of the current site.

Resolves: #78021
Releases: master, 7.6, 6.2
Change-Id: Ib13d7aac9a75b2be54c7fddf6896af2f0a52e18e
Reviewed-on: https://review.typo3.org/50198
Reviewed-by: Helmut Hummel <typo3@helhum.io>
Tested-by: Helmut Hummel <typo3@helhum.io>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index aeccb0c..52d00be 100644 (file)
@@ -2278,6 +2278,10 @@ class TypoScriptFrontendController
         }
         $GET = GeneralUtility::_GET();
         if ($this->cHash && is_array($GET)) {
+            if (!isset($GET['id'])) {
+                // id not in $_GET -> home page -> use already determined id
+                $GET['id'] = $this->id;
+            }
             $this->cHash_array = $this->cacheHash->getRelevantParameters(GeneralUtility::implodeArrayForUrl('', $GET));
             $cHash_calc = $this->cacheHash->calculateCacheHash($this->cHash_array);
             if ($cHash_calc != $this->cHash) {