[wp-trac] [WordPress Trac] #11330: Empty search takes you to homepage instead of empty search page

WordPress Trac noreply at wordpress.org
Thu May 29 18:14:55 UTC 2014


#11330: Empty search takes you to homepage instead of empty search page
------------------------------+-----------------------------
 Reporter:  jacobfogg         |       Owner:  wonderboymusic
     Type:  defect (bug)      |      Status:  reopened
 Priority:  low               |   Milestone:  4.0
Component:  Query             |     Version:  2.8.5
 Severity:  minor             |  Resolution:
 Keywords:  has-patch commit  |     Focuses:
------------------------------+-----------------------------
Changes (by SergeyBiryukov):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 1. Why limiting this to the main query? I'd expect `WP_Query( 's=' )` to
 work the same way, which would be consistent with #28099.
 2. `array_key_exists()` can be replaced with `isset()`, and removing
 `$this->is_main_query()` makes the `$qv['s']` check redundant (a non-empty
 `$qv['s']` means that `$this->query['s']` is set).
 3. `$search = 'AND 0'` looks confusing where it is, it could be moved to a
 more appropriate place.

 [attachment:11330.3.diff] addresses these points.

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


More information about the wp-trac mailing list