[wp-trac] [WordPress Trac] #18052: 'category__and' does not filter invalid input by itself

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 10 15:01:22 UTC 2012


#18052: 'category__and' does not filter invalid input by itself
--------------------------+------------------------------
 Reporter:  drale2k       |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:  3.2
 Severity:  normal        |  Resolution:  invalid
 Keywords:                |
--------------------------+------------------------------
Changes (by wonderboymusic):

 * keywords:  needs-patch reporter-feedback =>
 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Future Release => Awaiting Review


Comment:

 2 things:

 1) don't use query_posts - make a new WP_Query or alter the main query
 using 'pre_get_posts' if absolutely necessary

 2) if you pass: {{{'category__and' => array( 1, 2, 3, false )}}}  - your
 query should fail, you should be validating your inputs

 Related: #20604

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


More information about the wp-trac mailing list