WordPress.org

Make WordPress Core

Ticket #42096: 42096.patch

File 42096.patch, 1.2 KB (added by tomllobet, 3 years ago)

patch with sanitize_title_for_query

  • src/wp-includes/class-wp-term-query.php

     
    483483                        ( is_string( $args['slug'] ) && 0 !== strlen( $args['slug'] ) )
    484484                ) {
    485485                        if ( is_array( $args['slug'] ) ) {
    486                                 $slug = array_map( 'sanitize_title', $args['slug'] );
     486                                $slug = array_map( 'sanitize_title_for_query', $args['slug'] );
    487487                                $this->sql_clauses['where']['slug'] = "t.slug IN ('" . implode( "', '", $slug ) . "')";
    488488                        } else {
    489                                 $slug = sanitize_title( $args['slug'] );
     489                                $slug = sanitize_title_for_query( $args['slug'] );
    490490                                $this->sql_clauses['where']['slug'] = "t.slug = '$slug'";
    491491                        }
    492492                }
  • src/wp-includes/default-filters.php

     
    7474}
    7575
    7676// Slugs
    77 add_filter( 'pre_term_slug', 'sanitize_title' );
     77add_filter( 'pre_term_slug', 'sanitize_title_for_query' );
    7878add_filter( 'wp_insert_post_data', '_wp_customize_changeset_filter_insert_post_data', 10, 2 );
    7979
    8080// Keys