We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 416753f + 75516f0 commit 8db386cCopy full SHA for 8db386c
src/LiveComponent/src/Util/LiveAttributesCollection.php
@@ -13,6 +13,7 @@
13
14
use Twig\Environment;
15
use Twig\Extension\EscaperExtension;
16
+use Twig\Runtime\EscaperRuntime;
17
18
/**
19
* An array of attributes that can eventually be returned as an escaped array.
@@ -114,6 +115,10 @@ public function setQueryUrlMapping(array $queryUrlMapping): void
114
115
116
private function escapeAttribute(string $value): string
117
{
118
+ if (class_exists(EscaperRuntime::class)) {
119
+ return $this->twig->getRuntime(EscaperRuntime::class)->escape($value, 'html_attr');
120
+ }
121
+
122
if (method_exists(EscaperExtension::class, 'escape')) {
123
return EscaperExtension::escape($this->twig, $value, 'html_attr');
124
}
0 commit comments