From 0cd103e2a25dd8265d92230c7ced8b7f0b2d33f1 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 9 Jul 2008 04:52:27 +0000 Subject: [PATCH] Hands off pre tags. Props nbachiyski. fixes #7056 git-svn-id: http://svn.automattic.com/wordpress/trunk@8298 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index e605da909c..e2b969a6a0 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -3,6 +3,7 @@ function wptexturize($text) { global $wp_cockneyreplace; $next = true; + $has_pre_parent = false; $output = ''; $curl = ''; $textarr = preg_split('/(<.*>|\[.*\])/Us', $text, -1, PREG_SPLIT_DELIM_CAPTURE); @@ -26,13 +27,17 @@ function wptexturize($text) { for ( $i = 0; $i < $stop; $i++ ) { $curl = $textarr[$i]; - if (isset($curl{0}) && '<' != $curl{0} && '[' != $curl{0} && $next) { // If it's not a tag + if (isset($curl{0}) && '<' != $curl{0} && '[' != $curl{0} && $next && !$has_pre_parent) { // If it's not a tag // static strings $curl = str_replace($static_characters, $static_replacements, $curl); // regular expressions $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl); - } elseif (strpos($curl, '') !== false) { + $has_pre_parent = false; } else { $next = true; }