[wp-trac] [WordPress Trac] #18076: get_term() should never query for term_id = 0

WordPress Trac wp-trac at lists.automattic.com
Tue Jul 12 02:26:05 UTC 2011


#18076: get_term() should never query for term_id = 0
--------------------------+-----------------------------
 Reporter:  mdawaffe      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  3.2
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------------
 In one branch of its logic, {{{get_term()}}} casts the input as an integer
 and uses that value to lookup the term by term_id (first in the cache,
 then in the DB).  That's unnecessary for 0.

 This can happen on every page load via {{{wp_get_nav_menu_object( $string
 )}}}.

 Attached bails on 0.

 Attached also switches the prepared query to use %d instead of %s.

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


More information about the wp-trac mailing list