[wp-trac] [WordPress Trac] #33864: Cannot add accented tag if non-accented look-alike exists (eg. szel, szél)

WordPress Trac noreply at wordpress.org
Sat Oct 3 20:24:11 UTC 2015


#33864: Cannot add accented tag if non-accented look-alike exists (eg. szel, szél)
------------------------------------+---------------------------
 Reporter:  geza.miklo              |       Owner:  boonebgorges
     Type:  defect (bug)            |      Status:  closed
 Priority:  normal                  |   Milestone:  4.4
Component:  Taxonomy                |     Version:  4.3
 Severity:  normal                  |  Resolution:  fixed
 Keywords:  has-patch dev-feedback  |     Focuses:
------------------------------------+---------------------------
Changes (by boonebgorges):

 * owner:   => boonebgorges
 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"34809"]:
 {{{
 #!CommitTicketReference repository="" revision="34809"
 When creating terms, avoid false dupe checks due to accented characters.

 `wp_insert_term()` doesn't allow the creation of a term when the term
 `name`
 is the same as another term in the same hierarchy level of the same
 taxonomy.
 Previously, this duplicate check used `get_term_by( 'name' )`, which uses
 the
 database collation to determine sameness. But common collations do not
 distinguish between accented and non-accented versions of a character. As
 a
 result, it was impossible to create a term 'Foo' if a sibling term with an
 accented character existed.

 We address this problem by using `get_terms()` to do the duplicate check.
 This
 query returns all potentially matching terms. We then do a stricter check
 for equivalence in PHP, before determining whether one of the matches is
 indeed a duplicate.

 Props boonebgorges, tyxla, geza.miklo, mehulkaklotar.
 Fixes #33864.
 }}}

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


More information about the wp-trac mailing list