[wp-trac] [WordPress Trac] #55407: Allow case-insensitive elements for KSES
WordPress Trac
noreply at wordpress.org
Thu Mar 31 03:44:03 UTC 2022
#55407: Allow case-insensitive elements for KSES
----------------------------------------+---------------------
Reporter: r-a-y | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.0
Component: Formatting | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests | Focuses:
----------------------------------------+---------------------
Comment (by peterwilsoncc):
I'll resolve this ticket with the documentation fix in
[attachment:"55407.diff"].
As browsers treat HTML tags and attributes without case sensitivity, KSES
needs to as well to match the behavior.
The affect of this is KSES does need to be a little stricter with
developers when adding elements to the array of supported values. This
requires the values all be in lowercase.
I did consider whether it could be resolved by code to allow both
uppercase and lowercase elements in the allow list, but it would have a
performance hit looping through the array each time and would cause
problems for developers wishing to remove elements from the allow list.
Removing `div` would also require removing `DIV`, `Div`, `DIv`, and the
other possible combinations.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/55407#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list