diff --git a/b2-include/b2functions.php b/b2-include/b2functions.php index ee2048b910..71d9f13aca 100644 --- a/b2-include/b2functions.php +++ b/b2-include/b2functions.php @@ -99,19 +99,20 @@ function wptexturize($text) { } function wpautop($pee, $br=1) { - $pee = preg_replace("/(\r\n|\n|\r)/", "\n", $pee); // cross-platform newlines - $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates - $pee = preg_replace('/\n?(.+?)(\n\n|\z)/s', "
$1
\n", $pee); // make paragraphs, including one at the end - $pee = preg_replace('/\s*(<(?:table|ol|ul|pre|select|form)>)/', "$1", $pee); - $pee = preg_replace('!((?:table|ol|ul|pre|select|form)>)
!', "$1", $pee); - if ($br) $pee = preg_replace('|(?)\s*\n|', "]*)>|i', "', $pee); - $pee = str_replace('', '", $pee); - $pee = str_replace('
', '
', $pee); - $pee = preg_replace('#
\s*#', '', $pee); - $pee = preg_replace('/&[^#](?![a-z]*;)/', '&', $pee); - return $pee; + $pee = preg_replace('|$1
\n", $pee); // make paragraphs, including one at the end + $pee = str_replace('', '
', $pee); + $pee = str_replace('
', '', $pee); + $pee = preg_replace('!\s*(?(?:table|ul|ol|li|pre|select|form|blockquote)>)!', "$1", $pee); + $pee = preg_replace('!(?(?:table|ul|ol|li|pre|select|form|blockquote)>)\s*
!', "$1", $pee); + if ($br) $pee = preg_replace('|(?)\s*\n|', "]*)>|i', "', $pee); + return $pee; } function autobrize($content) {', '", $pee); + $pee = str_replace('