Index: wp-includes/default-filters.php
===================================================================
--- wp-includes/default-filters.php	(revision 12407)
+++ wp-includes/default-filters.php	(working copy)
@@ -110,6 +110,7 @@
 add_filter( 'the_content', 'wpautop'            );
 add_filter( 'the_content', 'shortcode_unautop'  );
 add_filter( 'the_content', 'prepend_attachment' );
+add_filter( 'the_content', '_escape_cdata_close', 20);
 
 add_filter( 'the_excerpt',     'wptexturize'      );
 add_filter( 'the_excerpt',     'convert_smilies'  );
Index: wp-includes/post-template.php
===================================================================
--- wp-includes/post-template.php	(revision 12407)
+++ wp-includes/post-template.php	(working copy)
@@ -164,7 +164,6 @@
 function the_content($more_link_text = null, $stripteaser = 0) {
 	$content = get_the_content($more_link_text, $stripteaser);
 	$content = apply_filters('the_content', $content);
-	$content = str_replace(']]>', ']]&gt;', $content);
 	echo $content;
 }
 
Index: wp-includes/comment.php
===================================================================
--- wp-includes/comment.php	(revision 12407)
+++ wp-includes/comment.php	(working copy)
@@ -1566,11 +1566,12 @@
 		return;
 	}
 
-	if ( empty($post->post_excerpt) )
+	if ( empty($post->post_excerpt) ) {
 		$excerpt = apply_filters('the_content', $post->post_content);
-	else
+	} else {
 		$excerpt = apply_filters('the_excerpt', $post->post_excerpt);
-	$excerpt = str_replace(']]>', ']]&gt;', $excerpt);
+		$excerpt = str_replace(']]>', ']]&gt;', $excerpt);
+	}
 	$excerpt = wp_html_excerpt($excerpt, 252) . '...';
 
 	$post_title = apply_filters('the_title', $post->post_title);
Index: wp-includes/formatting.php
===================================================================
--- wp-includes/formatting.php	(revision 12407)
+++ wp-includes/formatting.php	(working copy)
@@ -1807,7 +1807,6 @@
 		$text = strip_shortcodes( $text );
 
 		$text = apply_filters('the_content', $text);
-		$text = str_replace(']]>', ']]&gt;', $text);
 		$text = strip_tags($text);
 		$excerpt_length = apply_filters('excerpt_length', 55);
 		$excerpt_more = apply_filters('excerpt_more', '[...]');
@@ -2846,4 +2845,8 @@
 	return apply_filters('sanitize_text_field', $filtered, $str);
 }
 
+function _escape_cdata_close($content) {
+	return str_replace(']]>', ']]&gt;', $content);
+}
+
 ?>
Index: wp-includes/feed.php
===================================================================
--- wp-includes/feed.php	(revision 12407)
+++ wp-includes/feed.php	(working copy)
@@ -145,7 +145,6 @@
 		$feed_type = get_default_feed();
 
 	$content = apply_filters('the_content', get_the_content());
-	$content = str_replace(']]>', ']]&gt;', $content);
 	return apply_filters('the_content_feed', $content, $feed_type);
 }
 
