[wp-trac] [WordPress Trac] #42426: Search by keyword in non-English language site doesn't work
WordPress Trac
noreply at wordpress.org
Fri Nov 3 02:32:11 UTC 2017
#42426: Search by keyword in non-English language site doesn't work
--------------------------+-----------------------------
Reporter: PT Guy | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version: 4.8.3
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
'''# The Query'''
{{{
$the_query = new WP_Query( array(
's' => 'Лорем',
) );
}}}
'''# Result'''
No posts found.
'''# Reason'''
The executed query ''$the_query->request'' included placeholder strings:
{{{
wp_posts.post_title LIKE
'{290b944af99425682ef70000028625991093545a19c3cd2ccbf53c91848c62a7}Лорем{290b944af99425682ef70000028625991093545a19c3cd2ccbf53c91848c62a7}'
}}}
which were added in parse_search() by $wpdb->prepare(), but were not
removed before execution.
'''# Solution'''
{{{
global $wpdb;
add_filter( 'posts_request', array( $wpdb, 'remove_placeholder_escape' ),
10, 2 );
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42426>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list