Make WordPress Core

Ticket #25709: 25709.diff

File 25709.diff, 824 bytes (added by nacin, 11 years ago)
  • src/wp-includes/query.php

     
    19791979
    19801980                $stopwords = $this->get_search_stopwords();
    19811981
     1982                $pcre_utf8 = (bool) @preg_match( '/\pL/u', 'w' );
     1983
    19821984                foreach ( $terms as $term ) {
    19831985                        // keep before/after spaces when term is for exact match
    19841986                        if ( preg_match( '/^".+"$/', $term ) )
     
    19871989                                $term = trim( $term, "\"' " );
    19881990
    19891991                        // \p{L} matches a single letter that is not a Chinese, Japanese, etc. char
    1990                         if ( ! $term || @preg_match( '/^\p{L}$/u', $term ) )
     1992                        if ( ! $term || ( $pcre_utf8 && preg_match( '/^\p{L}$/u', $term ) ) )
    19911993                                continue;
    19921994
    19931995                        if ( in_array( call_user_func( $strtolower, $term ), $stopwords, true ) )