[wp-trac] [WordPress Trac] #44988: The sanitize_html_class() is deceptive / "buggy"

WordPress Trac noreply at wordpress.org
Fri Sep 11 02:40:12 UTC 2020


#44988: The sanitize_html_class() is deceptive / "buggy"
----------------------------+------------------------------
 Reporter:  ChiefAlchemist  |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Formatting      |     Version:  4.9.6
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+------------------------------

Comment (by lgedeon):

 If another core function is using sanitize_html_class() to get something
 that is not valid for an html class, then that function is in error and
 should be fixed.

 If a significant number of plugins or themes outside core are relying on
 sanitize_html_class() being wrong, however, then we might just have to
 leave this alone.

 If we can fix this though, I would prefer that the function add an
 underscore to the front rather than replace a character, if the only place
 the character is invalid is that it is in front.

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


More information about the wp-trac mailing list