﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
16717,Wrong error handling in query.php::get_posts(),fabifott,,"The bug seems to be in a back compat block, so not very important:
In lines 2187 and 2199 get_term_by() is called. In following line it is just checked if it returns are logical true value.:
{{{
$the_cat = get_term_by( $cat_query['field'], $cat_query['terms'][0], 'category' );
if ( $the_cat ) {
	$this->set( 'cat', $the_cat->term_id );
	$this->set( 'category_name', $the_cat->slug );
}
}}}

But get_term_by calls get_term(), and this function can return WP_Error. As a result, the error is not handled properly. This caused several warnings in Debug Mode, since the WP_Error object is treated as a Category object. The bug is actually in get_term_by() since it returns false in error case by definition.



",defect (bug),closed,normal,3.1.1,Query,3.1,minor,fixed,has-patch dev-feedback,nerx
