Query stopwords: Only eliminate single A-Z letters as search terms.

Stop trying to match any single letters that are not East Asian characters, as this requires PCRE with UTF-8 support; and because it doesn't actually work.

fixes #25709.


git-svn-id: https://develop.svn.wordpress.org/trunk@25954 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-10-27 20:50:31 +00:00
parent 61b82f7eb3
commit 47c58004fe

View File

@ -1986,8 +1986,8 @@ class WP_Query {
else else
$term = trim( $term, "\"' " ); $term = trim( $term, "\"' " );
// \p{L} matches a single letter that is not a Chinese, Japanese, etc. char // Avoid single A-Z.
if ( ! $term || @preg_match( '/^\p{L}$/u', $term ) ) if ( ! $term || ( 1 === strlen( $term ) && preg_match( '/^[a-z]$/i', $term ) ) )
continue; continue;
if ( in_array( call_user_func( $strtolower, $term ), $stopwords, true ) ) if ( in_array( call_user_func( $strtolower, $term ), $stopwords, true ) )