From c1e9ee019dcce4d8c2e5bc7d6feac95afa812598 Mon Sep 17 00:00:00 2001
From: donncha
Date: Wed, 5 Jul 2006 11:55:16 +0000
Subject: WP Merge. Delete feed code and sql
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@636 7be80a69-a1ef-0310-a953-fb0f7c49ff36
---
wp-includes/formatting.php | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
(limited to 'wp-includes/formatting.php')
diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index 7d52ed9..cc5e76b 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -70,7 +70,11 @@ function wpautop($pee, $br = 1) {
$pee = str_replace('
', '', $pee);
$pee = preg_replace('!\s*(?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)!', "$1", $pee);
$pee = preg_replace('!(?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*
!', "$1", $pee);
- if ($br) $pee = preg_replace('|(?)\s*\n|', "
\n", $pee); // optionally make line breaks
+ if ($br) {
+ $pee = preg_replace('/<(script|style).*?<\/\\1>/se', 'str_replace("\n", "", "\\0")', $pee);
+ $pee = preg_replace('|(?)\s*\n|', "
\n", $pee); // optionally make line breaks
+ $pee = str_replace('', "\n", $pee);
+ }
$pee = preg_replace('!(?(?:table|thead|tfoot|caption|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*
!', "$1", $pee);
$pee = preg_replace('!
(\s*?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)!', '$1', $pee);
$pee = preg_replace('!()(.*?)!ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '' ", $pee);
@@ -505,6 +509,9 @@ function balanceTags($text, $is_comment = 0, $force = false) {
return $newtext;
}
+function force_balance_tags($text) {
+ return balanceTags($text, 0, true);
+}
function format_to_edit($content, $richedit = false) {
$content = apply_filters('format_to_edit', $content);
--
cgit