From c6531fe271d5bc1d2fbbe6f3f629d1f83b5e0d42 Mon Sep 17 00:00:00 2001 From: matt Date: Fri, 1 Dec 2006 02:53:20 +0000 Subject: [PATCH] Don't texturize things inside of script or style tags, fixes #2647 git-svn-id: http://svn.automattic.com/wordpress/trunk@4565 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 8344d31432..5faac073da 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -32,7 +32,7 @@ function wptexturize($text) { // regular expressions $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl); - } elseif (strstr($curl, '$1

\n", $pee); // make paragraphs, including one at the end $pee = preg_replace('|

\s*?

|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace + $pee = preg_replace( '|

(]*>\s*)|', "$1

", $pee ); + $pee = preg_replace('!

([^<]+)\s*?(]*>)!', "

$1

$2", $pee); + $pee = preg_replace( '|

|', "$1

", $pee ); $pee = preg_replace('!

\s*(]*>)\s*

!', "$1", $pee); // don't pee all over a tag $pee = preg_replace("|

(|", "$1", $pee); // problem with nested lists $pee = preg_replace('|

]*)>|i', "

", $pee); @@ -79,6 +82,7 @@ function wpautop($pee, $br = 1) { if ( strstr( $pee, ')(.*?)!ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '' ", $pee); $pee = preg_replace( "|\n

$|", '

', $pee ); +/**/ return $pee; }