File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 12
12
namespace Symfony \UX \LiveComponent \Util ;
13
13
14
14
use Twig \Environment ;
15
+ use Twig \Extension \EscaperExtension ;
15
16
16
17
/**
17
18
* An array of attributes that can eventually be returned as an escaped array.
@@ -99,6 +100,11 @@ public function setBrowserEventsToDispatch(array $browserEventsToDispatch): void
99
100
100
101
private function escapeAttribute (string $ value ): string
101
102
{
102
- return twig_escape_filter ($ this ->twig , $ value , 'html_attr ' );
103
+ if (method_exists (EscaperExtension::class, 'escape ' )) {
104
+ return EscaperExtension::escape ($ this ->twig , $ value , 'html_attr ' );
105
+ }
106
+
107
+ // since twig/twig 3.9.0: Using the internal "twig_escape_filter" function is deprecated.
108
+ return (string ) twig_escape_filter ($ this ->twig , $ value , 'html_attr ' );
103
109
}
104
110
}
You can’t perform that action at this time.
0 commit comments