[wp-trac] [WordPress Trac] #13278: query.php, exclude posts by more authors bug

WordPress Trac wp-trac at lists.automattic.com
Thu May 6 15:18:33 UTC 2010


#13278: query.php, exclude posts by more authors bug
--------------------------+-------------------------------------------------
 Reporter:  aesqe         |       Owner:  ryan
     Type:  defect (bug)  |      Status:  new 
 Priority:  normal        |   Milestone:  3.0 
Component:  Query         |     Version:      
 Severity:  normal        |    Keywords:      
--------------------------+-------------------------------------------------
 in latest nightly on lines 2053 - 2054:

 {{{
 $q['author'] = explode('-', $q['author']);
 $q['author'] = (string)absint($q['author'][1]);
 }}}

 just removing 'absint' from line 2054 would enable queries like this
 following one to give expected results (posts where author ids are not 1
 or 2):

 {{{
 `query_posts('author=-1,2')`
 }}}

 replacing both lines with something like this:

 {{{
 $q['author'] = str_replace('-', '', $q['author']);
 }}}

 would also allow this input:

 {{{
 `query_posts('author=-1,-2')`
 }}}

 currently, these queries just exclude the author whose ID is first in
 list.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/13278>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list