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

WordPress Trac wp-trac at lists.automattic.com
Sun Sep 9 22:20:35 UTC 2012


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

 * keywords:  needs-patch => has-patch


Comment:

 Patch does the following:

 1) {{{WP_Query::is_search}}} is true if 's' query var exists (isset)

 2) The search query becomes {{{AND 0}}} if the term is empty so the SQL
 query will tank right away

 3) Ditches the comment join generation if the search term is empty

 Result: empty search terms go to the search page

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11330#comment:14>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list