[wp-trac] [WordPress Trac] #11112: get_term() does not verify for valid output from wpdb::get_row()

WordPress Trac wp-trac at lists.automattic.com
Tue Nov 10 03:39:56 UTC 2009


#11112: get_term() does not verify for valid output from wpdb::get_row()
--------------------------+-------------------------------------------------
 Reporter:  johncoswell   |       Owner:  filosofo  
     Type:  defect (bug)  |      Status:  new       
 Priority:  low           |   Milestone:  Unassigned
Component:  Taxonomy      |     Version:  2.9       
 Severity:  minor         |    Keywords:            
--------------------------+-------------------------------------------------
 It's possible for wpdb::get_row() to return invalid data from a request to
 get_term(), yet there's no type checking done on the return value from
 wpdb::get_row(), which can cause PHP to raise warnings when returning
 something other than an object. Something similar to this should fix the
 issue (/wp-includes/taxonomy.php, ~line 332):

 {{{
 if (is_object($_term)) {
   if ($output == OBJECT) {
     ...
   } elseif (...) {
     ...
   }
 } else {
   return $_term; // or maybe WP_Error
 }
 }}}

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


More information about the wp-trac mailing list