Index: wp-includes/formatting.php
===================================================================
--- wp-includes/formatting.php	(revision 4262)
+++ wp-includes/formatting.php	(working copy)
@@ -1,6 +1,7 @@
 <?php
 
 function wptexturize($text) {
+	global $wpautocorrect;
 	$output = '';
 	// Capture tags and everything inside them
 	$textarr = preg_split("/(<.*>)/Us", $text, -1, PREG_SPLIT_DELIM_CAPTURE);
@@ -16,10 +17,9 @@
 			$curl = str_replace('...', '&#8230;', $curl);
 			$curl = str_replace('``', '&#8220;', $curl);
 
-			// This is a hack, look at this more later. It works pretty well though.
-			$cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause");
-			$cockneyreplace = array("&#8217;tain&#8217;t","&#8217;twere","&#8217;twas","&#8217;tis","&#8217;twill","&#8217;til","&#8217;bout","&#8217;nuff","&#8217;round","&#8217;cause");
-			$curl = str_replace($cockney, $cockneyreplace, $curl);
+			// Replacement for cockneyreplace
+			// Array now set in wp-config.php or wp-includes/vars.php
+			$curl = str_replace(array_keys($wpautocorrect), array_values($wpautocorrect), $curl);
 
 			$curl = preg_replace("/'s/", '&#8217;s', $curl);
 			$curl = preg_replace("/'(\d\d(?:&#8217;|')?s)/", "&#8217;$1", $curl);
Index: wp-includes/vars.php
===================================================================
--- wp-includes/vars.php	(revision 4262)
+++ wp-includes/vars.php	(working copy)
@@ -92,4 +92,20 @@
 	$wp_smiliesreplace[] = " <img src='" . get_option('siteurl') . "/wp-includes/images/smilies/$img' alt='$smiley_masked' class='wp-smiley' /> ";
 }
 
+// if the config file does not provide the autocorrect array, let's define it here
+if (!isset($wpautocorrect)) {
+	$wpautocorrect = array(
+	"'tain't" => '&#8217;tain&#8217;t',
+	"'twere"  => '&#8217;twere',
+	"'twas"   => '&#8217;twas',
+	"'tis"    => '&#8217;tis',
+	"'twill"  => '&#8217;twill',
+	"'til"    => '&#8217;til',
+	"'bout"   => '&#8217;bout',
+	"'nuff"   => '&#8217;nuff',
+	"'round"  => '&#8217;round',
+	"'cause"  => '&#8217;cause',
+	);
+}
+
 ?>
