[wp-trac] [WordPress Trac] #33121: wp_kses_attr_check fails to process html data-* attributes

WordPress Trac noreply at wordpress.org
Sun Oct 14 20:51:39 UTC 2018


#33121: wp_kses_attr_check fails to process html data-* attributes
--------------------------------------+-----------------------
 Reporter:  isoftware                 |       Owner:  (none)
     Type:  defect (bug)              |      Status:  reopened
 Priority:  normal                    |   Milestone:  5.0
Component:  Editor                    |     Version:  4.2.3
 Severity:  major                     |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------

Comment (by peterwilsoncc):

 I like the mixed approach in [attachment:"33121.5.diff"].

 The main thing I was trying to avoid was doubling up on adding the
 `data-*` prefix in `wp_kses_attr_check()` and
 `_wp_add_global_attributes()`.

 It occurs to me that in your patches the prefix doesn't need to be added
 to `_wp_add_global_attributes()`. If core needs multiple allowed prefixes
 in the future we can create a new private function, until then we can use
 your regex.

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


More information about the wp-trac mailing list