diff options
Diffstat (limited to 'wp-includes/formatting.php')
| -rw-r--r-- | wp-includes/formatting.php | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 6094dcb..d153fb9 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -1,6 +1,7 @@ <?php function wptexturize($text) { + global $wp_cockneyreplace; $output = ''; // Capture tags and everything inside them $textarr = preg_split("/(<.*>)/Us", $text, -1, PREG_SPLIT_DELIM_CAPTURE); @@ -16,9 +17,15 @@ function wptexturize($text) { $curl = str_replace('...', '…', $curl); $curl = str_replace('``', '“', $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("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round","’cause"); + // if a plugin has provided an autocorrect array, use it + if ( isset($wp_cockneyreplace) ) { + $cockney = array_keys($wp_cockneyreplace); + $cockney_replace = array_values($wp_cockneyreplace); + } else { + $cockney = array("'tain't","'twere","'twas","'tis","'twill","'til","'bout","'nuff","'round","'cause"); + $cockneyreplace = array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round","’cause"); + } + $curl = str_replace($cockney, $cockneyreplace, $curl); $curl = preg_replace("/'s/", '’s', $curl); @@ -249,7 +256,9 @@ function remove_accents($string) { chr(197).chr(188) => 'z', chr(197).chr(189) => 'Z', chr(197).chr(190) => 'z', chr(197).chr(191) => 's', // Euro Sign - chr(226).chr(130).chr(172) => 'E'); + chr(226).chr(130).chr(172) => 'E', + // GBP (Pound) Sign + chr(194).chr(163) => ''); $string = strtr($string, $chars); } else { @@ -613,7 +622,7 @@ function convert_smilies($text) { for ($i = 0; $i < $stop; $i++) { $content = $textarr[$i]; if ((strlen($content) > 0) && ('<' != $content{0})) { // If it's not a tag - $content = str_replace($wp_smiliessearch, $wp_smiliesreplace, $content); + $content = preg_replace($wp_smiliessearch, $wp_smiliesreplace, $content); } $output .= $content; } |
