Skip to content

Commit 041c42d

Browse files
author
Mathieu Lechat
committed
Allow trans filter to be safe
1 parent 1b92f06 commit 041c42d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,13 @@
219219
{% set label = name|humanize %}
220220
{%- endif -%}
221221
{%- endif -%}
222-
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}</label>
222+
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
223+
{%- if translation_domain is same as(false) -%}
224+
{{- label -}}
225+
{%- else -%}
226+
{{- label|trans({}, translation_domain) -}}
227+
{%- endif -%}
228+
</label>
223229
{%- endif -%}
224230
{%- endblock form_label -%}
225231

0 commit comments

Comments
 (0)