[wp-trac] [WordPress Trac] #56530: Combining tilde passes `sanitize_title_with_dashes()` and so do most other diacritics
WordPress Trac
noreply at wordpress.org
Wed Sep 7 23:25:41 UTC 2022
#56530: Combining tilde passes `sanitize_title_with_dashes()` and so do most other
diacritics
-------------------------+-------------------------------------------------
Reporter: anrghg | Owner: (none)
Type: defect | Status: new
(bug) |
Priority: normal | Milestone: Awaiting Review
Component: Formatting | Version:
Severity: major | Keywords: needs-dev-note needs-patch changes-
Focuses: | requested
-------------------------+-------------------------------------------------
Combining diacritics that are not acute, grave, hacek or macron (or the
deprecated Vietnamese acute tone mark) are not removed by
`sanitize_title_with_dashes()` removing characters individually and
explicitly **after** URL-encoding.
If the goal is to remove accents, best would be removing the full class
**before** URL-encoding:
{{{
$title = preg_replace( '/\p{M}/u', '', $title );
}}}
But isn’t `remove_accents()` called when removing diacritics?
So I’d suggest moving the combining diacritics part to `remove_accents()`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56530>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list