From 05fd92660a268fb05ca05776d81fa68fcdfe7879 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Wed, 8 Apr 2020 14:47:30 +0200 Subject: [PATCH] Specify HTML.Doctype as HTML 4 Strict for HTML Purifier Not setting a Doctype defaults to HTML 4 Transitional, allowing legacy tags. HTML 4 Strict will attempt to convert them into a standards compliant format. HTML Purifier does not support the HTML 5 Doctype as a readily available configuration. Before: string '

This is some text!

' (length=47) After: string '

This is some text!

' (length=66) --- .../system/html/input/filter/MessageHtmlInputFilter.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/wcfsetup/install/files/lib/system/html/input/filter/MessageHtmlInputFilter.class.php b/wcfsetup/install/files/lib/system/html/input/filter/MessageHtmlInputFilter.class.php index f8d6849798..a56d07032e 100644 --- a/wcfsetup/install/files/lib/system/html/input/filter/MessageHtmlInputFilter.class.php +++ b/wcfsetup/install/files/lib/system/html/input/filter/MessageHtmlInputFilter.class.php @@ -52,6 +52,7 @@ class MessageHtmlInputFilter implements IHtmlInputFilter { $config->set('CSS.AllowedProperties', ['color', 'font-family', 'font-size']); $config->set('HTML.ForbiddenAttributes', ['*@lang', '*@xml:lang']); + $config->set('HTML.Doctype', 'HTML 4.01 Strict'); $allowedSchemes = $config->get('URI.AllowedSchemes'); $allowedSchemes['ts3server'] = true; -- 2.20.1