From 036e63c31a9df783cff4021bb56f76d61d6b5e81 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Mon, 14 Mar 2016 14:12:25 +0000 Subject: [PATCH] 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 --- wp-includes/query.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 4b3e1e41f7..7bebfb4932 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -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 ) ) diff --git a/wp-includes/version.php b/wp-includes/version.php index 6e34d63cfe..da0901a8c1 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.