Index: wp-includes/formatting.php
===================================================================
--- wp-includes/formatting.php	(revision 17488)
+++ wp-includes/formatting.php	(working copy)
@@ -29,10 +29,8 @@
 function wptexturize($text) {
 	global $wp_cockneyreplace;
 	static $static_setup = false, $opening_quote, $closing_quote, $default_no_texturize_tags, $default_no_texturize_shortcodes, $static_characters, $static_replacements, $dynamic_characters, $dynamic_replacements;
-	$output = '';
-	$curl = '';
+
 	$textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
-	$stop = count($textarr);
 
 	// No need to set up these variables more than once
 	if (!$static_setup) {
@@ -70,17 +68,15 @@
 	$no_texturize_tags_stack = array();
 	$no_texturize_shortcodes_stack = array();
 
-	for ( $i = 0; $i < $stop; $i++ ) {
-		$curl = $textarr[$i];
-
-		if ( !empty($curl) && '<' != $curl[0] && '[' != $curl[0]
+	foreach( $textarr as &$curl ) {
+		if ( !empty( $curl ) && '<' != $curl[0] && '[' != $curl[0]
 				&& empty($no_texturize_shortcodes_stack) && empty($no_texturize_tags_stack)) {
 			// This is not a tag, nor is the texturization disabled
 			// static strings
 			$curl = str_replace($static_characters, $static_replacements, $curl);
 			// regular expressions
 			$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
-		} elseif (!empty($curl)) {
+		} elseif ( !empty( $curl ) ) {
 			/*
 			 * Only call _wptexturize_pushpop_element if first char is correct
 			 * tag opening
@@ -92,10 +88,9 @@
 		}
 
 		$curl = preg_replace('/&([^#])(?![a-zA-Z1-4]{1,8};)/', '&#038;$1', $curl);
-		$output .= $curl;
 	}
 
-	return $output;
+	return implode( '', $textarr );
 }
 
 /**
