[wp-trac] [WordPress Trac] #31954: `wp_update_term()` doesn't check for `null` after `get_term()`

WordPress Trac noreply at wordpress.org
Sun Apr 12 19:45:51 UTC 2015


#31954: `wp_update_term()` doesn't check for `null` after `get_term()`
--------------------------+-----------------------------
 Reporter:  dlh           |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 `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.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/31954>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list