Index: src/wp-includes/taxonomy.php
===================================================================
--- src/wp-includes/taxonomy.php	(revision 45550)
+++ src/wp-includes/taxonomy.php	(working copy)
@@ -193,7 +193,7 @@
 function get_taxonomies( $args = array(), $output = 'names', $operator = 'and' ) {
 	global $wp_taxonomies;
 
-	$field = ( 'names' == $output ) ? 'name' : false;
+	$field = ( 'names' === $output ) ? 'name' : false;
 
 	return wp_filter_object_list( $wp_taxonomies, $args, $operator, $field );
 }
@@ -223,7 +223,7 @@
 	global $wp_taxonomies;
 
 	if ( is_object( $object ) ) {
-		if ( $object->post_type == 'attachment' ) {
+		if ( $object->post_type === 'attachment' ) {
 			return get_attachment_taxonomies( $object, $output );
 		}
 		$object = $object->post_type;
@@ -234,7 +234,7 @@
 	$taxonomies = array();
 	foreach ( (array) $wp_taxonomies as $tax_name => $tax_obj ) {
 		if ( array_intersect( $object, (array) $tax_obj->object_type ) ) {
-			if ( 'names' == $output ) {
+			if ( 'names' === $output ) {
 				$taxonomies[] = $tax_name;
 			} else {
 				$taxonomies[ $tax_name ] = $tax_obj;
@@ -725,7 +725,7 @@
 	$defaults = array( 'order' => 'ASC' );
 	$args     = wp_parse_args( $args, $defaults );
 
-	$order = ( 'desc' == strtolower( $args['order'] ) ) ? 'DESC' : 'ASC';
+	$order = ( 'desc' === strtolower( $args['order'] ) ) ? 'DESC' : 'ASC';
 
 	$term_ids = array_map( 'intval', $term_ids );
 
@@ -876,9 +876,9 @@
 	// Sanitize term, according to the specified filter.
 	$_term->filter( $filter );
 
-	if ( $output == ARRAY_A ) {
+	if ( $output === ARRAY_A ) {
 		return $_term->to_array();
-	} elseif ( $output == ARRAY_N ) {
+	} elseif ( $output === ARRAY_N ) {
 		return array_values( $_term->to_array() );
 	}
 
@@ -1014,7 +1014,7 @@
 	$children = $terms[ $term_id ];
 
 	foreach ( (array) $terms[ $term_id ] as $child ) {
-		if ( $term_id == $child ) {
+		if ( $term_id === $child ) {
 			continue;
 		}
 
@@ -1371,7 +1371,7 @@
 	$tax_select = "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE ";
 
 	if ( is_int( $term ) ) {
-		if ( 0 == $term ) {
+		if ( 0 === $term ) {
 			return 0;
 		}
 		$where = 't.term_id = %d';
@@ -1440,7 +1440,7 @@
 	if ( empty( $term1->term_id ) || empty( $term2->parent ) ) {
 		return false;
 	}
-	if ( $term2->parent == $term1->term_id ) {
+	if ( $term2->parent === $term1->term_id ) {
 		return true;
 	}
 
@@ -1517,6 +1517,7 @@
  */
 function sanitize_term_field( $field, $value, $term_id, $taxonomy, $context ) {
 	$int_fields = array( 'parent', 'term_id', 'count', 'term_group', 'term_taxonomy_id', 'object_id' );
+	$context = strtolower( $context );
 	if ( in_array( $field, $int_fields ) ) {
 		$value = (int) $value;
 		if ( $value < 0 ) {
@@ -1524,11 +1525,11 @@
 		}
 	}
 
-	if ( 'raw' == $context ) {
+	if ( 'raw' === $context ) {
 		return $value;
 	}
 
-	if ( 'edit' == $context ) {
+	if ( 'edit' === $context ) {
 
 		/**
 		 * Filters a term field to edit before it is sanitized.
@@ -1556,12 +1557,12 @@
 		 */
 		$value = apply_filters( "edit_{$taxonomy}_{$field}", $value, $term_id );
 
-		if ( 'description' == $field ) {
+		if ( 'description' === $field ) {
 			$value = esc_html( $value ); // textarea_escaped
 		} else {
 			$value = esc_attr( $value );
 		}
-	} elseif ( 'db' == $context ) {
+	} elseif ( 'db' === $context ) {
 
 		/**
 		 * Filters a term field value before it is sanitized.
@@ -1588,7 +1589,7 @@
 		$value = apply_filters( "pre_{$taxonomy}_{$field}", $value );
 
 		// Back compat filters
-		if ( 'slug' == $field ) {
+		if ( 'slug' === $field ) {
 			/**
 			 * Filters the category nicename before it is sanitized.
 			 *
@@ -1600,7 +1601,7 @@
 			 */
 			$value = apply_filters( 'pre_category_nicename', $value );
 		}
-	} elseif ( 'rss' == $context ) {
+	} elseif ( 'rss' === $context ) {
 
 		/**
 		 * Filters the term field for use in RSS.
@@ -1657,9 +1658,9 @@
 		$value = apply_filters( "{$taxonomy}_{$field}", $value, $term_id, $context );
 	}
 
-	if ( 'attribute' == $context ) {
+	if ( 'attribute' === $context ) {
 		$value = esc_attr( $value );
-	} elseif ( 'js' == $context ) {
+	} elseif ( 'js' === $context ) {
 		$value = esc_js( $value );
 	}
 	return $value;
@@ -1761,9 +1762,9 @@
 
 	$defaults = array();
 
-	if ( 'category' == $taxonomy ) {
+	if ( 'category' === $taxonomy ) {
 		$defaults['default'] = get_option( 'default_category' );
-		if ( $defaults['default'] == $term ) {
+		if ( $defaults['default'] === $term ) {
 			return 0; // Don't delete the default category
 		}
 	}
@@ -1841,7 +1842,7 @@
 				'orderby' => 'none',
 			)
 		);
-		if ( 1 == count( $terms ) && isset( $default ) ) {
+		if ( 1 === count( $terms ) && isset( $default ) ) {
 			$terms = array( $default );
 		} else {
 			$terms = array_diff( $terms, array( $term ) );
@@ -2117,10 +2118,10 @@
 	if ( is_wp_error( $term ) ) {
 		return $term;
 	}
-	if ( is_int( $term ) && 0 == $term ) {
+	if ( is_int( $term ) && 0 === $term ) {
 		return new WP_Error( 'invalid_term_id', __( 'Invalid term ID.' ) );
 	}
-	if ( '' == trim( $term ) ) {
+	if ( '' === trim( $term ) ) {
 		return new WP_Error( 'empty_term_name', __( 'A name is required for this term.' ) );
 	}
 	$defaults = array(
@@ -2444,7 +2445,7 @@
 	$new_tt_ids = array();
 
 	foreach ( (array) $terms as $term ) {
-		if ( ! strlen( trim( $term ) ) ) {
+		if ( '' === trim( $term ) ) {
 			continue;
 		}
 
@@ -2603,7 +2604,7 @@
 	$tt_ids = array();
 
 	foreach ( (array) $terms as $term ) {
-		if ( ! strlen( trim( $term ) ) ) {
+		if ( '' === trim( $term ) ) {
 			continue;
 		}
 
@@ -2838,7 +2839,7 @@
 	$parsed_args['name']        = $name;
 	$parsed_args['description'] = $description;
 
-	if ( '' == trim( $name ) ) {
+	if ( '' === trim( $name ) ) {
 		return new WP_Error( 'empty_term_name', __( 'A name is required for this term.' ) );
 	}
 
@@ -2898,10 +2899,10 @@
 
 	// Check for duplicate slug
 	$duplicate = get_term_by( 'slug', $slug, $taxonomy );
-	if ( $duplicate && $duplicate->term_id != $term_id ) {
+	if ( $duplicate && $duplicate->term_id !== $term_id ) {
 		// If an empty slug was passed or the parent changed, reset the slug to something unique.
 		// Otherwise, bail.
-		if ( $empty_slug || ( $parent != $term['parent'] ) ) {
+		if ( $empty_slug || ( $parent !== $term['parent'] ) ) {
 			$slug = wp_unique_term_slug( $slug, (object) $args );
 		} else {
 			/* translators: %s: taxonomy term slug */
@@ -3506,7 +3507,7 @@
 	$term_list    = array();
 	$has_children = _get_term_hierarchy( $taxonomy );
 
-	if ( ( 0 != $term_id ) && ! isset( $has_children[ $term_id ] ) ) {
+	if ( ( 0 !== $term_id ) && ! isset( $has_children[ $term_id ] ) ) {
 		return $empty_array;
 	}
 
@@ -3530,7 +3531,7 @@
 			continue;
 		}
 
-		if ( $term->parent == $term_id ) {
+		if ( $term->parent === $term_id ) {
 			if ( $use_id ) {
 				$term_list[] = $term->term_id;
 			} else {
@@ -3785,7 +3786,7 @@
 	 * If there's a mismatch, it may mean that the term is already split. Return the actual term_id from the db.
 	 */
 	$check_term_id = $wpdb->get_var( $wpdb->prepare( "SELECT term_id FROM $wpdb->term_taxonomy WHERE term_taxonomy_id = %d", $term_taxonomy_id ) );
-	if ( $check_term_id != $term_id ) {
+	if ( $check_term_id !== $term_id ) {
 		return $check_term_id;
 	}
 
@@ -4007,12 +4008,12 @@
  * @param string $taxonomy         Taxonomy for the split term.
  */
 function _wp_check_split_default_terms( $term_id, $new_term_id, $term_taxonomy_id, $taxonomy ) {
-	if ( 'category' != $taxonomy ) {
+	if ( 'category' !== $taxonomy ) {
 		return;
 	}
 
 	foreach ( array( 'default_category', 'default_link_category', 'default_email_category' ) as $option ) {
-		if ( $term_id == get_option( $option, -1 ) ) {
+		if ( $term_id === get_option( $option, -1 ) ) {
 			update_option( $option, $new_term_id );
 		}
 	}
@@ -4073,7 +4074,7 @@
 	// Update menu locations.
 	$locations = get_nav_menu_locations();
 	foreach ( $locations as $location => $menu_id ) {
-		if ( $term_id == $menu_id ) {
+		if ( $term_id === $menu_id ) {
 			$locations[ $location ] = $new_term_id;
 		}
 	}
@@ -4193,7 +4194,7 @@
 	$t    = get_taxonomy( $taxonomy );
 
 	if ( empty( $termlink ) ) {
-		if ( 'category' == $taxonomy ) {
+		if ( 'category' === $taxonomy ) {
 			$termlink = '?cat=' . $term->term_id;
 		} elseif ( $t->query_var ) {
 			$termlink = "?$t->query_var=$slug";
@@ -4218,7 +4219,7 @@
 		$termlink = home_url( user_trailingslashit( $termlink, 'category' ) );
 	}
 	// Back Compat filters.
-	if ( 'post_tag' == $taxonomy ) {
+	if ( 'post_tag' === $taxonomy ) {
 
 		/**
 		 * Filters the tag link.
@@ -4230,7 +4231,7 @@
 		 * @param int    $term_id  Term ID.
 		 */
 		$termlink = apply_filters( 'tag_link', $termlink, $term->term_id );
-	} elseif ( 'category' == $taxonomy ) {
+	} elseif ( 'category' === $taxonomy ) {
 
 		/**
 		 * Filters the category link.
@@ -4553,7 +4554,7 @@
 	}
 
 	// Can't be its own parent.
-	if ( $parent == $term_id ) {
+	if ( $parent === $term_id ) {
 		return 0;
 	}
 
