Changeset 37082
- Timestamp:
- 03/25/2016 06:40:27 PM (9 years ago)
- Location:
- branches/4.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.4
-
branches/4.4/src/wp-includes/query.php
r36354 r37082 2232 2232 $term = trim( $term, "\"' " ); 2233 2233 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 ) ) ) 2236 2236 continue; 2237 2237 -
branches/4.4/tests/phpunit/tests/query/search.php
r36354 r37082 128 128 129 129 /** 130 * @ticket 36195 131 */ 132 public function test_s_should_not_exclude_for_dashes_between_words() { 133 $p1 = self::factory()->post->create( array( 134 'post_status' => 'publish', 135 'post_content' => 'This post has foo but also bar', 136 ) ); 137 $p2 = self::factory()->post->create( array( 138 'post_status' => 'publish', 139 'post_content' => 'This post has only bar', 140 ) ); 141 $p3 = self::factory()->post->create( array( 142 'post_status' => 'publish', 143 'post_content' => 'This post has only foo - bar', 144 ) ); 145 146 $q = new WP_Query( array( 147 's' => 'foo - bar', 148 'fields' => 'ids', 149 ) ); 150 151 $this->assertEqualSets( array( $p1, $p3 ), $q->posts ); 152 } 153 154 /** 130 155 * @ticket 35361 131 156 */
Note: See TracChangeset
for help on using the changeset viewer.