Query: Ignore search terms consisting of a single dash.

Due to the "exclude" support added in WP 4.4, single dashes were being
converted to "NOT LIKE '%%'" clauses, causing all searches to fail.

Props RomSocial, swissspidy.
Fixes #36195.
Built from https://develop.svn.wordpress.org/trunk@36989


git-svn-id: http://core.svn.wordpress.org/trunk@36956 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Boone Gorges 2016-03-14 14:12:25 +00:00
parent cac6d65780
commit 036e63c31a
2 changed files with 3 additions and 3 deletions

View File

@ -2194,8 +2194,8 @@ class WP_Query {
else
$term = trim( $term, "\"' " );
// Avoid single A-Z.
if ( ! $term || ( 1 === strlen( $term ) && preg_match( '/^[a-z]$/i', $term ) ) )
// Avoid single A-Z and single dashes.
if ( ! $term || ( 1 === strlen( $term ) && preg_match( '/^[a-z\-]$/i', $term ) ) )
continue;
if ( in_array( call_user_func( $strtolower, $term ), $stopwords, true ) )

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.5-beta3-36988';
$wp_version = '4.5-beta3-36989';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.