[wp-trac] [WordPress Trac] #29589: term_exists() short-circuits and results in duplicate inserts.

WordPress Trac noreply at wordpress.org
Thu Sep 25 22:20:42 UTC 2014


#29589: term_exists() short-circuits and results in duplicate inserts.
-----------------------------+------------------------------
 Reporter:  georgestephanis  |       Owner:
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Taxonomy         |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:  needs-patch      |     Focuses:
-----------------------------+------------------------------

Comment (by georgestephanis):

 To hopefully save someone some blame tracking, this is due to

 https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/taxonomy.php?annotate=blame#L1680

 which goes back to [8433] and #6593 --

 {{{
 if ( '' === $slug = sanitize_title($term) )
     return 0;
 }}}

 So it always says the term doesn't exist (returning 0) if it sanitizes
 down to an empty string.

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


More information about the wp-trac mailing list