File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/TwigComponent/src/Twig Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1515use Symfony \UX \TwigComponent \ComponentAttributes ;
1616use Twig \Environment ;
1717use Twig \Extension \EscaperExtension ;
18+ use Twig \Runtime \EscaperRuntime ;
1819
1920/**
2021 * @final
@@ -31,7 +32,9 @@ public function configure(Environment $environment): void
3132 $ this ->decorated ->configure ($ environment );
3233 $ environment ->setLexer (new ComponentLexer ($ environment ));
3334
34- if ($ environment ->hasExtension (EscaperExtension::class)) {
35+ if (class_exists (EscaperRuntime::class)) {
36+ $ environment ->getRuntime (EscaperRuntime::class)->addSafeClass (ComponentAttributes::class, ['html ' ]);
37+ } elseif ($ environment ->hasExtension (EscaperExtension::class)) {
3538 $ environment ->getExtension (EscaperExtension::class)->addSafeClass (ComponentAttributes::class, ['html ' ]);
3639 }
3740 }
You can’t perform that action at this time.
0 commit comments