[wp-trac] [WordPress Trac] #40680: Add support for `'tag' => true` in `wp_kses_attr()`
WordPress Trac
noreply at wordpress.org
Fri May 5 19:00:16 UTC 2017
#40680: Add support for `'tag' => true` in `wp_kses_attr()`
-------------------------+---------------------------------------------
Reporter: ocean90 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Future Release
Component: Security | Version:
Severity: normal | Keywords: has-patch has-unit-tests commit
Focuses: |
-------------------------+---------------------------------------------
Related: [meta5483], #20017
`wp_kses_attr()` uses `$allowed_html[strtolower($element)]) == 0` to check
whether any attributes are allowed for an element. There's at least
[https://core.trac.wordpress.org/browser/tags/4.7.4/src/wp-admin/includes
/class-automatic-upgrader-skin.php?marks=89-91#L84 one place] where `true`
is used to define the support of '''no''' attributes. But because `count(
true )` returns 1 unnecessary checks for the support of attributes are
performed.
I don't see anything wrong with using `true` as an alternative for an
empty array and because it's already supported for attributes (#20017) I
suggest to add official support for `true` in `wp_kses_attr()` as well.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40680>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list