File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ /*
6+ * This file is part of the Extension "sf_event_mgt" for TYPO3 CMS.
7+ *
8+ * For the full copyright and license information, please read the
9+ * LICENSE.txt file that was distributed with this source code.
10+ */
11+
12+ namespace DERHANSEN \SfEventMgt \Security ;
13+
14+ use TYPO3Fluid \Fluid \Core \Cache \FluidCacheInterface ;
15+ use TYPO3Fluid \Fluid \Core \Cache \FluidCacheWarmerInterface ;
16+ use TYPO3Fluid \Fluid \Core \Cache \StandardCacheWarmer ;
17+
18+ /**
19+ * A no-op Fluid cache implementation that never stores or returns compiled templates.
20+ * Used in parseStringFluid() to ensure templates are always parsed from source,
21+ * so that AllowedViewHelperInvoker is invoked on every render.
22+ */
23+ class NullFluidCache implements FluidCacheInterface
24+ {
25+ public function get (string $ name ): mixed
26+ {
27+ return null ;
28+ }
29+
30+ public function set (string $ name , mixed $ value ): void {}
31+
32+ public function flush (?string $ name = null ): void {}
33+
34+ public function getCacheWarmer (): FluidCacheWarmerInterface
35+ {
36+ return new StandardCacheWarmer ();
37+ }
38+ }
Original file line number Diff line number Diff line change 1212namespace DERHANSEN \SfEventMgt \Service ;
1313
1414use DERHANSEN \SfEventMgt \Security \AllowedViewHelperInvoker ;
15+ use DERHANSEN \SfEventMgt \Security \NullFluidCache ;
1516use TYPO3 \CMS \Core \Http \ApplicationType ;
1617use TYPO3 \CMS \Core \Utility \GeneralUtility ;
1718use TYPO3 \CMS \Core \View \ViewFactoryData ;
@@ -83,6 +84,7 @@ public function parseString(
8384 1727434457
8485 );
8586 }
87+ $ view ->getRenderingContext ()->setCache (new NullFluidCache ());
8688 $ view ->getRenderingContext ()->setViewHelperInvoker (new AllowedViewHelperInvoker ());
8789 $ view ->getRenderingContext ()->setTemplateProcessors ([
8890 new NamespaceDetectionTemplateProcessor (),
You can’t perform that action at this time.
0 commit comments