Index: wp-includes/post-template.php
===================================================================
--- wp-includes/post-template.php	(revision 16364)
+++ wp-includes/post-template.php	(working copy)
@@ -165,7 +165,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 16364)
+++ wp-includes/comment.php	(working copy)
@@ -1710,7 +1710,6 @@
 		$excerpt = apply_filters('the_content', $post->post_content);
 	else
 		$excerpt = apply_filters('the_excerpt', $post->post_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 16364)
+++ wp-includes/formatting.php	(working copy)
@@ -1881,7 +1881,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', ' ' . '[...]');
@@ -2906,4 +2905,26 @@
 
 }
 
+/**
+ * Wrap a string in CDATA tags for inclusion of non-XML in XML.
+ *
+ * @since 3.2.0
+ */
+function wp_cdata( $string ) {
+	return '<![CDATA[' . wp_escape_cdata( $string ) . ']]>';
+}
+
+/**
+ * Make a string safe for inclusion in a CDATA block.
+ *
+ * The only invalid string in CDATA is "]]>". Since adjacent CDATA sections
+ * are equivalent to the result of their concatenation, the preferred method
+ * of including "]]>" is to split it between two sections.
+ *
+ * @since 3.2.0
+ */
+function wp_escape_cdata( $string ) {
+	return str_replace( ']]>', ']]]><![CDATA[]>', $string );
+}
+
 ?>
Index: wp-includes/deprecated.php
===================================================================
--- wp-includes/deprecated.php	(revision 16364)
+++ wp-includes/deprecated.php	(working copy)
@@ -1734,7 +1734,6 @@
 		$excerpt .= ($use_dotdotdot) ? '...' : '';
 		$content = $excerpt;
 	}
-	$content = str_replace(']]>', ']]&gt;', $content);
 	echo $content;
 }
 
Index: wp-includes/feed.php
===================================================================
--- wp-includes/feed.php	(revision 16364)
+++ 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);
 }
 
