Skip to content

question - code review (templates/crud/index.html.twig) #7367

@pfpro

Description

@pfpro

Yes, I know that AI can lead to misunderstandings. But during the last synchronization of my individual easyadmin bundle templates, I received this GitHub Copilot notification:

The change from e('html_attr') to e('html') for escaping the data-label attribute value is incorrect. The data-label is an HTML attribute, so it should be escaped using 'html_attr' to properly escape characters like quotes that have special meaning in HTML attributes. Using 'html' escaping instead could lead to XSS vulnerabilities or broken HTML when the label contains quotes.

<td data-column="{{ field.property }}" data-label="{{ field.label|trans|e('html') }}" class="{{ is_searchable ? 'searchable' }} {{ field.property == sort_field_name ? 'sorted' }} text-{{ field.textAlign }} {{ field.cssClass }}" dir="{{ ea.i18n.textDirection }}" {% for name, value in field.htmlAttributes %}{{ name }}="{{ value|e('html_attr') }}" {% endfor %}>

Is this a false alarm or something that still needs to be corrected in the original easyadmin template?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions