Opened 7 months ago
Last modified 6 months ago
#61396 new defect (bug)
Duplicate terms with different cases with slug transliteration on the pre_insert_term hook — at Version 1
Reported by: | oglekler | Owned by: | |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
On the /wp-admin/edit-tags.php page, an attempt to add terms Test
and test
is leading to an error "A term with the name provided already exists in this taxonomy." and the term is not added, but if I am doing the same thing in Russian language with the usage of a plugin (CyrToLat in this case) that is making slug transliteration via the pre_insert_term
filter, I am getting duplicate terms. I am not sure that this issue should be addressed to the plugin developer, because it looks like after filtering the term, we still need to ensure that this term is valid and comply with existing rules.
@mihdan FYI
Note: See
TracTickets for help on using
tickets.
pre_insert_term
filter is only for the term itself and not filtering all $args and the plugin in question had only one opportunity to transliterate slug hooking sanitize_title(), which looks like a last resort instead of expected behavior, but this is not the source of the issue.The source of trouble is strtolower(), which is only converting ASCII characters 🤦