Opened 23 months ago
Closed 21 months ago
#18076 closed defect (bug) (fixed)
get_term() should never query for term_id = 0
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 3.3 |
| Component: | General | Version: | 3.2 |
| Severity: | normal | Keywords: | westi-likes has-patch commit |
| Cc: |
Description
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.
Attachments (1)
Change History (4)
- Keywords 3.3-early westi-likes commit added
- Owner set to westi
- Status changed from new to accepted
- Keywords 3.3-early removed
- Milestone changed from Awaiting Review to 3.3
Note: See
TracTickets for help on using
tickets.

In [18591]: