diff --git a/wp-includes/functions-formatting.php b/wp-includes/functions-formatting.php index 661374bd0c..8726f33556 100644 --- a/wp-includes/functions-formatting.php +++ b/wp-includes/functions-formatting.php @@ -46,6 +46,12 @@ function wptexturize($text) { return $output; } +function clean_pre($text) { + $text = stripslashes($text); + $text = str_replace('
', '', $text); + return $text; +} + function wpautop($pee, $br = 1) { $pee = $pee . "\n"; // just to make things a little easier, pad the end $pee = preg_replace('|
\s*
|', "\n\n", $pee); @@ -64,6 +70,7 @@ function wpautop($pee, $br = 1) { if ($br) $pee = preg_replace('|(?)\s*\n|', "
\n", $pee); // optionally make line breaks $pee = preg_replace('!(]*>)\s*
!', "$1", $pee); $pee = preg_replace('!
(\s*)!', '$1', $pee); + $pee = preg_replace('!()(.*?)!ise', " '$1' . clean_pre('$2') . '' ", $pee); $pee = preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $pee); return $pee;