Opened 11 years ago
Closed 11 years ago
#31954 closed defect (bug) (fixed)
`wp_update_term()` doesn't check for `null` after `get_term()`
| Reported by: | dlh | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.2 |
| Component: | Taxonomy | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
We could use an existing string,
'Empty Term'(upper case).