Make WordPress Core


Ignore:
Timestamp:
03/25/2016 06:40:27 PM (9 years ago)
Author:
boonebgorges
Message:

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.

Location:
branches/4.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4

  • branches/4.4/src/wp-includes/query.php

    r36354 r37082  
    22322232                $term = trim( $term, "\"' " );
    22332233
    2234             // Avoid single A-Z.
    2235             if ( ! $term || ( 1 === strlen( $term ) && preg_match( '/^[a-z]$/i', $term ) ) )
     2234            // Avoid single A-Z and single dashes.
     2235            if ( ! $term || ( 1 === strlen( $term ) && preg_match( '/^[a-z\-]$/i', $term ) ) )
    22362236                continue;
    22372237
Note: See TracChangeset for help on using the changeset viewer.