Ticket #1032: autocorrect.diff
File autocorrect.diff, 2.2 KB (added by , 20 years ago) |
---|
-
wp-includes/functions-formatting.php
old new 1 1 <?php 2 2 3 3 function wptexturize($text) { 4 global $wpautocorrect; 4 5 $output = ''; 5 6 // Capture tags and everything inside them 6 7 $textarr = preg_split("/(<.*>)/Us", $text, -1, PREG_SPLIT_DELIM_CAPTURE); … … 15 16 $curl = str_replace('...', '…', $curl); 16 17 $curl = str_replace('``', '“', $curl); 17 18 18 // This is a hack, look at this more later. It works pretty well though. 19 $cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round"); 20 $cockneyreplace = array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round"); 21 $curl = str_replace($cockney, $cockneyreplace, $curl); 19 // Replacement for cockneyreplace 20 // Array now set in wp-config.php or wp-includes/vars.php 21 $curl = str_replace( array_keys($wpautocorrect), array_values($wpautocorrect), $curl ); 22 22 23 23 $curl = preg_replace("/'s/", '’s', $curl); 24 24 $curl = preg_replace("/'(\d\d(?:’|')?s)/", "’$1", $curl); -
wp-includes/vars.php
Only in trunk/wp-includes: languages diff -u --recursive trunk-svn/wp-includes/vars.php trunk/wp-includes/vars.php
old new 105 105 $wp_smiliesreplace[] = " <img src='" . get_settings('siteurl') . "/wp-images/smilies/$img' alt='$smiley_masked' class='wp-smiley' /> "; 106 106 } 107 107 108 // if the config file does not provide the autocorrect array, let's define it here 109 if (!isset($wpautocorrect)) { 110 $wpautocorrect = array( 111 "'tain't" => '’tain’t', 112 "'twere" => '’twere', 113 "'twas" => '’twas', 114 "'tis" => '’tis', 115 "'twill" => '’twill', 116 "'til" => '’til', 117 "'bout" => '’bout', 118 "'nuff" => '’nuff', 119 "'round" => '’round', 120 ); 121 } 122 108 123 // Path for cookies 109 124 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('home') . '/' ) ); 110 125 define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', get_settings('siteurl') . '/' ) );