[wp-trac] [WordPress Trac] #14704: _get_term_hierarchy() should check for populated array

WordPress Trac wp-trac at lists.automattic.com
Thu Aug 26 15:55:22 UTC 2010


#14704: _get_term_hierarchy() should check for populated array
--------------------------+-------------------------------------------------
 Reporter:  zaremedia     |       Owner:                 
     Type:  defect (bug)  |      Status:  new            
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:                 
 Severity:  minor         |    Keywords:                 
--------------------------+-------------------------------------------------
 http://core.trac.wordpress.org/browser/trunk/wp-
 includes/taxonomy.php#L2311

 By default, the 'category_children' option is populated with a serialized
 empty PHP array. So upon first call, it correctly yields an *empty* array.
 This code succeeds in the if() block and returns the empty array to the
 calling function.

 My suggestion is to change this to something like: if (!empty($children))

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


More information about the wp-trac mailing list