﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
20150,allowing get_posts to exclude more than one author,hugcape,,"I'm trying to exclude more than one author from the posts list this way:

{{{
query_posts( array('author'=>'-1,4',...));
}}}

but only the first one author_id is taken into account. I found at wp-includes/query.php, function get_posts, line 2282:
(I'm adding the $q!['author'] debug as a comments)
{{{
 if ( strpos($q['author'], '-') !== false ) {          #DBG: $q['author'] = ""-1,4""
       $eq = '!=';
       $andor = 'AND';
       $q['author'] = explode('-', $q['author']);      #DBG: $q['author'] = array("""", ""1,4"") 
       $q['author'] = (string)absint($q['author'][1]); #DBG: $q['author'] = ""1""
} else {
       $eq = '=';
      $andor = 'OR';
}
$author_array = preg_split('/[,\s]+/', $q['author']);  #DBG: $author_array = array(""1"")

}}}

I think the (string)absint should be removed from line 2282, so the $author_array value will be array(""1"", ""4"") which is the result we want.
  ",enhancement,closed,normal,,Query,3.3.1,minor,duplicate,,
