diff --git a/Classes/Cache/Listener/NoIntScriptsListener.php b/Classes/Cache/Listener/NoIntScriptsListener.php index 148e69e3c18..ce64ad44651 100644 --- a/Classes/Cache/Listener/NoIntScriptsListener.php +++ b/Classes/Cache/Listener/NoIntScriptsListener.php @@ -5,6 +5,7 @@ namespace SFC\Staticfilecache\Cache\Listener; use SFC\Staticfilecache\Event\CacheRuleEvent; +use TYPO3\CMS\Frontend\Cache\NonceValueSubstitution; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; class NoIntScriptsListener @@ -14,6 +15,12 @@ public function __invoke(CacheRuleEvent $event): void $tsfe = $GLOBALS['TSFE'] ?? null; if ($tsfe instanceof TypoScriptFrontendController && $tsfe->isINTincScript()) { foreach ((array) $tsfe->config['INTincScript'] as $key => $configuration) { + + // Check CSP Handling + // if (isset($configuration['target']) && $configuration['target'] === NonceValueSubstitution::class . '->substituteNonce') { + // continue; + // } + $event->addExplanation(__CLASS__ . ':' . $key, 'The page has a INTincScript: ' . implode(', ', $this->getInformation($configuration))); } } diff --git a/Classes/Cache/Listener/StaticCacheableListener.php b/Classes/Cache/Listener/StaticCacheableListener.php index 68b320af98b..1a019894d07 100644 --- a/Classes/Cache/Listener/StaticCacheableListener.php +++ b/Classes/Cache/Listener/StaticCacheableListener.php @@ -23,6 +23,8 @@ public function __construct(private readonly Typo3Version $typo3Version) {} */ public function __invoke(CacheRuleEvent $event): void { + // @todo migrate this event to check + // $request->getAttribute('frontend.cache.instruction')->isCachingAllowed() if (($GLOBALS['TSFE'] ?? null) instanceof TypoScriptFrontendController) { if ($this->typo3Version->getMajorVersion() >= 13) { /* @phpstan-ignore-next-line */