You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* [SECURITY] Properly encode noscript child nodes
The `<noscript>` element has a special behavior when
being evaluated in browsers, which depends on whether
script-parsing is enabled or disabled.
As a consequence this change will
* encode comment inner data, e.g. `<!-- <"comment"> -->`
as `<!-- <"comment"> -->`
* always encode tag attributes, e.g. `<p id="<value>">`
as `<p id="<value>">`
* extend `Comment` and `CdataSection` to have a constructor
(which triggers encoding per default) and to implement the
`Behavior\HandlerInterface`
* add a new serializer option `encode_attributes`, which might
basically be extracted to `Masterminds\HTML5`
* [TASK] Ensure attribute serialization preserves values as is
We don't want so called double-encoding – which is a valid
usecase when HTML describes how HTML is to be written – to
be automagically transformed to single encoded values,
as otherwise a valid input like
<a title="Insert &amp; to write an &"></a>
(Browser would show "Insert & to write an &")
…would be changed to:
<a title="Insert & to write an &"></a>
(Browser would show "Insert & to write an &")
Also add tests for the attribute encoding we want:
* Encode quotes, tags and stuff that might cause security issues
* do not encode unnecessarily encode slashes or colons
(like htmlentitites would do)
---------
Co-authored-by: Benjamin Franzke <[email protected]>
0 commit comments