[wp-trac] [WordPress Trac] #37009: When two different tags generate the same slug, the second tag is rejected

WordPress Trac noreply at wordpress.org
Mon Jun 6 21:01:25 UTC 2016


#37009: When two different tags generate the same slug, the second tag is rejected
------------------------------+---------------------------
 Reporter:  michael.costanza  |       Owner:  boonebgorges
     Type:  defect (bug)      |      Status:  assigned
 Priority:  normal            |   Milestone:  4.6
Component:  Taxonomy          |     Version:  4.5.2
 Severity:  normal            |  Resolution:
 Keywords:                    |     Focuses:
------------------------------+---------------------------
Changes (by boonebgorges):

 * owner:   => boonebgorges
 * status:  new => assigned
 * milestone:  Awaiting Review => 4.6


Comment:

 @michael.costanza Thanks for the detailed report, and welcome to WordPress
 Trac!

 The low-level taxonomy API (`wp_insert_term()`) supports the creation of
 terms like `$foo` and `#foo` in just the way you've suggested - by mapping
 them to slugs `foo` and `foo-2`. I'll add a test that demonstrates this.
 However, this breaks when calling `wp_set_object_terms()`, because of the
 use of the imprecise `term_exists()`. `term_exists()` runs the passed
 value through `sanitize_title()` (which reduces `$foo` to `foo`), so it
 thinks that the post already has the term. We should switch to using more
 precise checks.

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


More information about the wp-trac mailing list