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

linebreaksbr is not safe - add html_encode filter? #906

Closed
schungx opened this issue Apr 8, 2024 · 1 comment
Closed

linebreaksbr is not safe - add html_encode filter? #906

schungx opened this issue Apr 8, 2024 · 1 comment

Comments

@schungx
Copy link

schungx commented Apr 8, 2024

Right now, if I use linebreaksbr, I have to pair it with the safe filter...

However, that opens me up to injection attacks, as the text itself may contain HTML tags and/or scripts etc...

There is no html_encode filter, otherwise I can simply do:

{{ value | html_encode | linebreaksbr | safe }}
@schungx
Copy link
Author

schungx commented Apr 8, 2024

There is the escape filter. Sorry.

@schungx schungx closed this as completed Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant