sanitize_html - Twig Filter
Info
Contao overrides Symfony’s default sanitize_html filter
in order to also sanitize Contao-specific special characters like insert tags.
Default sanitizer
The default sanitizer is configured in framework.html_sanitizer.sanitizer.default and allows all “safe” elements and
attributes, as defined by the W3C Standard Proposal. You can find more
information about it in the Symfony documentation.
Info
Use the default sanitizer for HTML code that comes from external sources.
Contao sanitizer
Info
If you use the filter with the 'contao' sanitizer the HTML code is sanitized according to the rules configured in the
security section in the Contao system settings. Insert tags do not get encoded and unclosed tags do not get
automatically closed in this case.
Info
Use the contao sanitizer for HTML code that comes from the Contao backend, e.g. from a tinyMCE editor.