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

Content element HTML encode =,<, > #3501

Closed
zonky2 opened this issue Sep 25, 2021 · 6 comments
Closed

Content element HTML encode =,<, > #3501

zonky2 opened this issue Sep 25, 2021 · 6 comments
Labels
Milestone

Comments

@zonky2
Copy link
Contributor

zonky2 commented Sep 25, 2021

Affected version(s)

Contao 4.9.20 and Contao 4.4.57

Description
Content element HTML encode =,<, >
older versions did not do this

FireShot Pro Webpage Screenshot #604 - 'Artikel Inhaltselemente I demo contao org' - demo contao org

Workaround: add own dca file tl_content.php with

$GLOBALS['TL_DCA']['tl_content']['fields']['html']['eval']['preserveTags'] = true;
@leofeyer leofeyer added the bug label Sep 25, 2021
@leofeyer leofeyer added this to the 4.9 milestone Sep 25, 2021
@fritzmg
Copy link
Contributor

fritzmg commented Sep 25, 2021

This is already fixed in the current 4.9 branch. I could not reproduce it there at least.

// nvm, it is still reproducible there

@zonky2
Copy link
Contributor Author

zonky2 commented Sep 25, 2021

I have just tried this in the demo approx. 13:15h

@fritzmg
Copy link
Contributor

fritzmg commented Sep 25, 2021

However, if you set Allowed HTML attributes to * *, then only < gets encoded (which is expected, I think?).

@zonky2
Copy link
Contributor Author

zonky2 commented Sep 25, 2021

Nothing should be encoded in the content element HTML - IMHO

What I don't understand is that this is content and not an attribute?

@fritzmg
Copy link
Contributor

fritzmg commented Sep 25, 2021

Nothing should be encoded in the content element HTML - IMHO

If you don't want anything encoded, you can set the allowed HTML attributes to * *. And not allowed HTML tags will still get encoded, that has always been the case.

@leofeyer
Copy link
Member

leofeyer commented Oct 19, 2021

This is the expected behavior. The HTML field has the allowHtml attribute set, so it allows HTML according to your settings.

Note that <, > and = alone are not valid HTML and are therefore encoded.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants