[BUGFIX] disableNoCacheParameter option allows TypoScript cache option 35/62835/3
authorBenni Mack <benni@typo3.org>
Thu, 9 Jan 2020 14:44:45 +0000 (15:44 +0100)
committerTobi Kretschmann <tobi@tobishome.de>
Wed, 15 Jan 2020 09:30:18 +0000 (10:30 +0100)
With this change applied, a TYPO3 installation having the
global "disableNoCacheParameter" option activated will
still disable the cache if set via TypoScript `config.no_cache = 1`.

However, the GET parameter is still not evaluated when
having the option activated.

Resolves: #87227
Releases: master, 9.5
Change-Id: Id33bd3aa9c8d042deffadeb19d8d64d52fad3371
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62835
Reviewed-by: Daniel Goerz <daniel.goerz@posteo.de>
Reviewed-by: Susanne Moog <look@susi.dev>
Reviewed-by: Tobi Kretschmann <tobi@tobishome.de>
Tested-by: Susanne Moog <look@susi.dev>
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Tobi Kretschmann <tobi@tobishome.de>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index 76e3d13..07138de 100644 (file)
@@ -2125,7 +2125,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
         // No cache
         // Set $this->no_cache TRUE if the config.no_cache value is set!
         if ($this->config['config']['no_cache']) {
-            $this->set_no_cache('config.no_cache is set');
+            $this->set_no_cache('config.no_cache is set', true);
         }
 
         // Auto-configure settings when a site is configured
@@ -3499,7 +3499,7 @@ class TypoScriptFrontendController implements LoggerAwareInterface
             $trigger = $file . ' on line ' . $line;
             $warning = '$GLOBALS[\'TSFE\']->set_no_cache() was triggered by ' . $trigger . '.';
         }
-        if ($GLOBALS['TYPO3_CONF_VARS']['FE']['disableNoCacheParameter']) {
+        if (!$internal && $GLOBALS['TYPO3_CONF_VARS']['FE']['disableNoCacheParameter']) {
             $warning .= ' However, $TYPO3_CONF_VARS[\'FE\'][\'disableNoCacheParameter\'] is set, so it will be ignored!';
             $this->getTimeTracker()->setTSlogMessage($warning, 2);
         } else {