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. Ports [36989] to the 4.4 branch. Props RomSocial, swissspidy. Fixes #36195. Built from https://develop.svn.wordpress.org/branches/4.4@37082 git-svn-id: http://core.svn.wordpress.org/branches/4.4@37049 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
71788d7c89
commit
f2410b407d
|
@ -2231,8 +2231,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 ) )
|
||||
|
|
Loading…
Reference in New Issue