xemlock / htmlpurifier-html5

HTML5 support for HTMLPurifier
https://packagist.org/packages/xemlock/htmlpurifier-html5
MIT License
101 stars 12 forks source link

Allow <fieldset> and <label> in untrusted mode #48

Closed xemlock closed 4 years ago

xemlock commented 5 years ago

Currently <fieldset> and <label> elements belong to unsafe part of HTML5_Forms module. When stripped of form and for attributes they are harmless. I think that hiding them behind HTML.Trusted flag, just as other form elements (and scripts) are, is too drastic a measure.

All safe elements: <fieldset>, <label> and <progress> should be extracted to a separate module (HTML5_SafeForms?). The module should be guarded by config setting (%HTML.SafeForms), allowing it to be enabled in untrusted mode.

Also, users expect that <fieldset> to be enabled by default: