[wp-trac] [WordPress Trac] #63724: HTML API: Reliably parse HTML attributes in `wp_kses_hair()`

WordPress Trac noreply at wordpress.org
Tue Jan 20 21:04:54 UTC 2026


#63724: HTML API: Reliably parse HTML attributes in `wp_kses_hair()`
--------------------------------------+-----------------------
 Reporter:  dmsnell                   |       Owner:  dmsnell
     Type:  enhancement               |      Status:  reopened
 Priority:  normal                    |   Milestone:  7.0
Component:  HTML API                  |     Version:  6.9
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------

Comment (by dmsnell):

 In [changeset:"61503" 61503]:
 {{{
 #!CommitTicketReference repository="" revision="61503"
 KSES: Early-abort in wp_kses_hair() when no attributes exist.

 When `wp_kses_hair()` calls into the HTML API to parse an attribute
 string, it checks if the result might be `null` and returns early,
 skipping a few minor operations. It could also skip when the returned
 attribute count is zero.

 This patch adds the additional check and early-return.

 Developed in: https://github.com/WordPress/wordpress-develop/pull/10764
 Discussed in: https://core.trac.wordpress.org/ticket/63724

 Follow-up to [61499].

 Props dd32, dmsnell, jonsurrell.
 See #63724.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63724#comment:24>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list