Index: wp-includes/taxonomy.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- wp-includes/taxonomy.php	(revision 39037)
+++ wp-includes/taxonomy.php	(revision )
@@ -2528,9 +2528,9 @@
  * Update term based on arguments provided.
  *
  * The $args will indiscriminately override all values with the same field name.
- * Care must be taken to not override important information need to update or
- * update will fail (or perhaps create a new term, neither would be acceptable).
  *
+ * To overcome possible data corruption 'term_id' will be removed from $args.
+ *
  * Defaults will set 'alias_of', 'description', 'parent', and 'slug' if not
  * defined in $args already.
  *
@@ -2542,16 +2542,13 @@
  * a WP_Error will be passed back. If you don't pass any slug, then a unique one
  * will be created for you.
  *
- * For what can be overrode in `$args`, check the term scheme can contain and stay
- * away from the term keys.
- *
  * @since 2.3.0
  *
  * @global wpdb $wpdb WordPress database abstraction object.
  *
  * @param int          $term_id  The ID of the term
  * @param string       $taxonomy The context in which to relate the term to the object.
- * @param array|string $args     Optional. Array of get_terms() arguments. Default empty array.
+ * @param array|string $args     Optional. Array of term data to be merged with term. Default empty array.
  * @return array|WP_Error Returns Term ID and Taxonomy Term ID
  */
 function wp_update_term( $term_id, $taxonomy, $args = array() ) {
@@ -2578,13 +2575,16 @@
 
 	// Escape data pulled from DB.
 	$term = wp_slash( $term );
+
+	// Unsetting 'term_id' to overcome possible data corruption.
+	unset( $args['term_id'] );
 
 	// Merge old and new args with new args overwriting old ones.
-	$args = array_merge($term, $args);
+	$args = array_merge( $term, $args );
 
-	$defaults = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => '');
+	$defaults    = array( 'alias_of' => '', 'description' => '', 'parent' => 0, 'slug' => '' );
-	$args = wp_parse_args($args, $defaults);
+	$args        = wp_parse_args( $args, $defaults );
-	$args = sanitize_term($args, $taxonomy, 'db');
+	$args        = sanitize_term( $args, $taxonomy, 'db' );
 	$parsed_args = $args;
 
 	// expected_slashed ($name)
@@ -2692,8 +2692,8 @@
 	$data = apply_filters( 'wp_update_term_data', $data, $term_id, $taxonomy, $args );
 
 	$wpdb->update( $wpdb->terms, $data, compact( 'term_id' ) );
-	if ( empty($slug) ) {
+	if ( empty( $slug ) ) {
-		$slug = sanitize_title($name, $term_id);
+		$slug = sanitize_title( $name, $term_id );
 		$wpdb->update( $wpdb->terms, compact( 'slug' ), compact( 'term_id' ) );
 	}
 
