[wp-trac] [WordPress Trac] #31665: Duplicate slugs in DB, created for hierarchical terms with long, non-latin names, when the default slug already exists

WordPress Trac noreply at wordpress.org
Tue Mar 17 11:39:21 UTC 2015


#31665: Duplicate slugs in DB, created for hierarchical terms with long, non-latin
names, when the default slug already exists
------------------------------------------+-----------------------------
 Reporter:  nevma                         |       Owner:
     Type:  defect (bug)                  |      Status:  new
 Priority:  normal                        |   Milestone:  Future Release
Component:  Taxonomy                      |     Version:  4.1.1
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:
------------------------------------------+-----------------------------
Changes (by boonebgorges):

 * keywords:   => needs-patch needs-unit-tests
 * milestone:  Awaiting Review => Future Release


Comment:

 Thank you for the report. This is going to be a problem for any slugs
 longer than 200, but obviously it's a lot more severe in the case of non-
 latin characters.

 My initial thought is that we should be doing a length check in
 `wp_unique_term_slug()` (which is used by both `wp_insert_term()` and
 `wp_update_term()`). If we find that the generated slug is longer than our
 schema can handle, truncate (in a multibyte-friendly way) to, say, 190
 chars, and then do the `-2`, `-3` etc suffix.

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


More information about the wp-trac mailing list