[wp-trac] [WordPress Trac] #17689: Terms should not be sanitized inside term_exists()

WordPress Trac noreply at wordpress.org
Fri May 2 17:06:21 UTC 2014


#17689: Terms should not be sanitized inside term_exists()
---------------------------------+-----------------------------
 Reporter:  blepoxp              |       Owner:
     Type:  defect (bug)         |      Status:  new
 Priority:  high                 |   Milestone:  Future Release
Component:  Taxonomy             |     Version:  3.2
 Severity:  normal               |  Resolution:
 Keywords:  has-patch 4.0-early  |     Focuses:
---------------------------------+-----------------------------
Changes (by aaroncampbell):

 * keywords:  has-patch needs-unit-tests 4.0-early => has-patch 4.0-early


Comment:

 I ran against this when doing a large import for a client. I came to the
 same solution as Sergey, using `get_term_by( 'name', '...' )` for my work
 around.

 [attachment:17689.7.diff] is an update of .6 (still using `get_term_by(
 'name', '...' )`), that applies cleanly and has more robust unit tests. I
 changed the unit tests to use $ instead of + because I think the idea of
 `wp_humanize_plus_minus()` is good but it's an enhancement that belongs in
 it's own ticket (and I want this test to still test our standard special
 character handling even after the plus/minus changes).  I also added tests
 for terms that have all special characters, and am testing that the
 returned errors contain the expected duplicate term ID.

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


More information about the wp-trac mailing list