[wp-trac] [WordPress Trac] #44988: The sanitize_html_class() is deceptive / "buggy"
WordPress Trac
noreply at wordpress.org
Fri Sep 28 10:36:50 UTC 2018
#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 ayeshrajans):
The patch above (which fixes the class name according to W3 spec) breaks
the tests including
`\Tests_Post_GetPostClass::test_with_utf8_category_slugs`. This is because
`\get_post_class` function uses this function to specifically get numeric
values sanitized although the return values break W3 spec.
We could of course fix the failing tests, but this will clearly break BC.
One way to fix this would be to introduce an additional boolean parameter
to the function that only enforces stricter validations only when
explicitly required so. Ugly solution for a minimal issue.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44988#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list