Make WordPress Core


Ignore:
Timestamp:
01/19/2016 04:09:32 AM (10 years ago)
Author:
boonebgorges
Message:

Don't double-escape the 'name' param in get_terms().

[32353] changed the way the 'name' param in get_terms() is sanitized, by
running it through sanitize_term_field( 'name' ) before performing the SQL
query. An unintentional side effect of this change was that the string is
double-escaped: once by wp_filter_kses(), and once by esc_sql(). The
double-escaping was causing 'name' queries to fail when the param contained
apostrophes or other escaped characters.

Fixes #35493.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/taxonomy.php

    r36323 r36348  
    13551355        $names = (array) $args['name'];
    13561356        foreach ( $names as &$_name ) {
    1357             $_name = sanitize_term_field( 'name', $_name, 0, reset( $taxonomies ), 'db' );
     1357            // `sanitize_term_field()` returns slashed data.
     1358            $_name = stripslashes( sanitize_term_field( 'name', $_name, 0, reset( $taxonomies ), 'db' ) );
    13581359        }
    13591360
Note: See TracChangeset for help on using the changeset viewer.