[wp-trac] [WordPress Trac] #31025: Searching by 0 (zero produces inconsistent results)

WordPress Trac noreply at wordpress.org
Wed Jan 13 04:34:57 UTC 2016


#31025: Searching by 0 (zero produces inconsistent results)
-------------------------------------------------+-------------------------
 Reporter:  jadpm                                |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  4.5
Component:  Query                                |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-      |     Focuses:
  refresh good-first-bug                         |  administration
-------------------------------------------------+-------------------------
Changes (by boonebgorges):

 * milestone:  Future Release => 4.5


Comment:

 Thanks, @swissspidy.

 The `WP_Query` test passes even without the patch :) We've got to throw a
 non-matching post in there to show that `s=0` doesn't return it.

 Also, `isset( $q['s'] )` will always be true, because of
 `fill_query_vars()`. This will cause `LIKE` clauses to be added to every
 `WP_Query` request. Let's use `strlen()` instead.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31025#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list