[wp-trac] [WordPress Trac] #33924: sanitize_html_class valid characters

WordPress Trac noreply at wordpress.org
Wed Dec 9 05:45:00 UTC 2015


#33924: sanitize_html_class valid characters
-------------------------------------------------+-------------------------
 Reporter:  m-e-h                                |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  Formatting                           |  Release
 Severity:  normal                               |     Version:  4.4
 Keywords:  has-patch 2nd-opinion has-unit-      |  Resolution:
  tests                                          |     Focuses:
-------------------------------------------------+-------------------------
Changes (by peterwilsoncc):

 * keywords:  has-patch needs-refresh => has-patch 2nd-opinion has-unit-
               tests


Comment:

 Refreshed in [attachment:33924.3.diff]:

 * adds unit tests for `sanitize_html_class`
 * add strict/permissive mode for the function (defaults to strict)
 * in strict mode the output is unchanged
 * in permissive mode the function removes white space and defers to
 `esc_attr`

 Permissive mode is compatible with the HTML5 spec. It allows for
 characters that need escaping in CSS.

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


More information about the wp-trac mailing list