[wp-trac] [WordPress Trac] #61052: WP_KSES: Allow double dash

WordPress Trac noreply at wordpress.org
Mon Apr 22 15:48:07 UTC 2024


#61052: WP_KSES: Allow double dash
--------------------------+-----------------------------
 Reporter:  cbravobernal  |      Owner:  (none)
     Type:  enhancement   |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Right now, WordPress does not allow double hyphens `--` inside data
 attributes.

 https://github.com/WordPress/wordpress-
 develop/blob/16237a11586b022861933fa738acd957eef6653e/src/wp-
 includes/kses.php#L1267

 That's a problem for Interactivity API directives like `data-wp-on--event`
 or `data-wp-bind--value`.

 Right now, all PHP with those directives parsed with this function, will
 not be rendered, stopping all kind of interactions.

 Because of that, static blocks are not supported yet(as they are saved in
 DB, and pass through a wp_kses before sending them to the browser).

 Some plugins are starting to notice the issue, like WooCommerce:
 https://github.com/woocommerce/woocommerce/issues/46722

 Can this function be updated to allow them?

 Is there any concern or edge case I could miss before creating a PR?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61052>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list