Opened 10 years ago
Closed 10 years ago
#31954 closed defect (bug) (fixed)
`wp_update_term()` doesn't check for `null` after `get_term()`
Reported by: | dlh | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.2 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Taxonomy | Keywords: | |
Focuses: | Cc: |
Description
get_term()
can return null
, but wp_update_term()
checks $term
for only a WP_Error
before proceeding as if it has an array. This can lead to a warning in array_merge($term, $args)
and a notice in wp_unslash( $args['name'] )
.
The attached patch adds a check for null
and a unit test.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
We could use an existing string,
'Empty Term'
(upper case).