Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions templates/forms/layouts/field.html.twig
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{% block field %}
<div class="form-field {{ layout_form_field_outer_classes|trim -}} {{- form_field_outer_core|trim -}}">
{% block contents %}
{% if show_label %}
<div class="{{- layout_form_field_outer_label_classes -}}">
{{- form_field_toggleable -}}
<label class="{{ layout_form_field_label_classes }}{{ form_field_label_trim }}" {% if field.id %}for="{{ form_field_for }}"{% endif %}>
{%- block label -%}
{%- if form_field_help -%}
<span class="tooltip" data-tooltip="{{ form_field_help|e }}">{{ form_field_label|raw }}</span>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was the escaping removed here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like us using |raw without concent from the person who writes the form. Either the property should be called label_html or it should indicate it in some other way, maybe something like

#474 (review)

but with html: true in it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well in this case it is a attribute, so it MUST use escape anyways. It should be added back anyways.

What about this PR itself? Will it be merged?

{%- else -%}
{{ form_field_label|raw }}
{%- endif -%}
{%- if form_field_required %}
<span class="required">*</span>
{%- endif -%}
{%- endblock -%}
</label>
</div>
{% endif %}
{%- block label -%}
{% if show_label %}
<div class="{{- layout_form_field_outer_label_classes -}}">
{{- form_field_toggleable -}}
<label class="{{ layout_form_field_label_classes }}{{ form_field_label_trim }}" {% if field.id %}for="{{ form_field_for }}"{% endif %}>
{%- if form_field_help -%}
<span class="tooltip" data-tooltip="{{ form_field_help }}">{{ form_field_label|raw }}</span>
{%- else -%}
{{ form_field_label|raw }}
{%- endif -%}
{%- if form_field_required %}
<span class="required">*</span>
{%- endif -%}
</label>
</div>
{% endif %}
{%- endblock -%}
<div class="{{ layout_form_field_outer_data_classes }}"
{% block global_attributes %}{% endblock %}
>
Expand Down