Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V4 & V5] HTML in page_description block bleed in the template #1227

Closed
lcharette opened this issue Sep 22, 2023 · 0 comments
Closed

[V4 & V5] HTML in page_description block bleed in the template #1227

lcharette opened this issue Sep 22, 2023 · 0 comments
Assignees
Labels
confirmed bug Something isn't working templating Related to the template feature UF4 UF5
Milestone

Comments

@lcharette
Copy link
Member

Chat discussion : https://chat.userfrosting.com/channel/support?msg=s9XotScA52Wc6r2Ja

When HTML is used in the page_description block, text can appear in the template, but only when double quotes are used:

this works as expected

{% extends 'pages/abstract/dashboard.html.twig' %}

{% block page_title %}Some title{% endblock %}

{% block page_description %}
    Some description with links 
    <a href='https://site1.com' target='_blank'>site1.com</a> и <a href='https://site2.com' target='_blank'>site2.com</a>
{% endblock %}

but this puts some part of href attributes at the left upper corner of the page

{% extends 'pages/abstract/dashboard.html.twig' %}

{% block page_title %}Some title{% endblock %}

{% block page_description %}
    Some description with links 
    <a href="https://site1.com" target="_blank">site1.com</a> and <a href="https://site2.com" target="_blank">site2.com</a>
{% endblock %} 

Capture d’écran, le 2023-09-22 à 16 21 48

Cause : HTML is not escapade here:

<meta name="description" content="{% block page_description %}This page has not yet been configured.{% endblock %}">

Fix:

<meta name="description" content="{{ block('page_description')|e }}">
@lcharette lcharette added confirmed bug Something isn't working templating Related to the template feature UF5 UF4 labels Sep 22, 2023
@lcharette lcharette added this to the 4.6.x milestone Sep 22, 2023
@lcharette lcharette self-assigned this Sep 22, 2023
lcharette added a commit that referenced this issue Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed bug Something isn't working templating Related to the template feature UF4 UF5
Projects
None yet
Development

No branches or pull requests

1 participant