[wp-trac] [WordPress Trac] #27810: wp_query taxonomy query by name doesn't seem to work if there's a space in the name

WordPress Trac noreply at wordpress.org
Fri Feb 6 02:01:27 UTC 2015


#27810: wp_query taxonomy query by name doesn't seem to work if there's a space in
the name
--------------------------+---------------------------
 Reporter:  neonWired     |       Owner:  boonebgorges
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  4.2
Component:  Taxonomy      |     Version:  3.9
 Severity:  normal        |  Resolution:  fixed
 Keywords:                |     Focuses:
--------------------------+---------------------------
Changes (by boonebgorges):

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


Comment:

 In [changeset:"31346"]:
 {{{
 #!CommitTicketReference repository="" revision="31346"
 Use field-specific sanitization in `WP_Tax_Query::transform_query()`.

 When terms are entered into the database, term fields are sanitized with
 `sanitize_term_field()`. To ensure that the `SELECT ... WHERE` queries in
 `WP_Tax_Query::transform_query()` are not broken by overzealous
 sanitization,
 `sanitize_term_field()` should be used in that case as well. This fixes a
 bug
 where a tax_query using 'field=name' would fail if the 'terms' parameter
 contained characters (like spaces) that were improperly removed by
 `sanitize_title_for_query()`.

 Fixes #27810.
 }}}

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


More information about the wp-trac mailing list