mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@36989 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 ) )
|
||||
|
||||
Reference in New Issue
Block a user