diff --git wp-admin/includes/media.php wp-admin/includes/media.php
index 33e7867..9038888 100644
--- wp-admin/includes/media.php
+++ wp-admin/includes/media.php
@@ -1343,7 +1343,10 @@ function get_media_item( $attachment_id, $args = null ) {
 		if ( !empty( $field[ $field['input'] ] ) )
 			$item .= $field[ $field['input'] ];
 		elseif ( $field['input'] == 'textarea' ) {
-			$item .= "<textarea type='text' id='$name' name='$name' $aria_required>" . esc_textarea( $field['value'] ) . '</textarea>';
+			if ( user_can_richedit() ) { // already escaped when user_can_richedit() = false
+				$field['value'] = esc_textarea( $field['value'] );
+			}
+			$item .= "<textarea type='text' id='$name' name='$name' $aria_required>" . $field['value'] . '</textarea>';
 		} else {
 			$item .= "<input type='text' class='text' id='$name' name='$name' value='" . esc_attr( $field['value'] ) . "' $aria_required />";
 		}
diff --git wp-admin/includes/meta-boxes.php wp-admin/includes/meta-boxes.php
index 42678db..96466b5 100644
--- wp-admin/includes/meta-boxes.php
+++ wp-admin/includes/meta-boxes.php
@@ -288,7 +288,7 @@ function post_tags_meta_box($post, $box) {
 	<div class="jaxtag">
 	<div class="nojs-tags hide-if-js">
 	<p><?php echo $taxonomy->labels->add_or_remove_items; ?></p>
-	<textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php echo $disabled; ?>><?php echo esc_textarea( get_terms_to_edit( $post->ID, $tax_name ) ); ?></textarea></div>
+	<textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php echo $disabled; ?>><?php echo get_terms_to_edit( $post->ID, $tax_name ); // escaped by esc_attr() ?></textarea></div>
  	<?php if ( current_user_can($taxonomy->cap->assign_terms) ) : ?>
 	<div class="ajaxtag hide-if-no-js">
 		<label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>
@@ -892,7 +892,7 @@ function link_advanced_meta_box($link) {
 	</tr>
 	<tr class="form-field">
 		<th valign="top"  scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>
-		<td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo esc_textarea( ( isset( $link->link_notes ) ? $link->link_notes : '') ); ?></textarea></td>
+		<td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); // escaped ?></textarea></td>
 	</tr>
 	<tr class="form-field">
 		<th valign="top"  scope="row"><label for="link_rating"><?php _e('Rating') ?></label></th>
diff --git wp-includes/bookmark.php wp-includes/bookmark.php
index ddb5e13..b99a719 100644
--- wp-includes/bookmark.php
+++ wp-includes/bookmark.php
@@ -334,14 +334,8 @@ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
 		return $value;
 
 	if ( 'edit' == $context ) {
-		$format_to_edit = array('link_notes');
 		$value = apply_filters("edit_$field", $value, $bookmark_id);
-
-		if ( in_array($field, $format_to_edit) ) {
-			$value = format_to_edit($value);
-		} else {
-			$value = esc_attr($value);
-		}
+		$value = esc_attr( $value );
 	} else if ( 'db' == $context ) {
 		$value = apply_filters("pre_$field", $value);
 	} else {
diff --git wp-includes/formatting.php wp-includes/formatting.php
index 82ce377..2f93cda 100644
--- wp-includes/formatting.php
+++ wp-includes/formatting.php
@@ -1126,7 +1126,7 @@ function force_balance_tags( $text ) {
 function format_to_edit($content, $richedit = false) {
 	$content = apply_filters('format_to_edit', $content);
 	if (! $richedit )
-		$content = htmlspecialchars($content);
+		$content = esc_textarea($content);
 	return $content;
 }
 
