diff --git a/wp-admin/post.php b/wp-admin/post.php index 99d80ffcd1..1e5dc3ba32 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -48,9 +48,9 @@ case 'post': $post_ID = $wpdb->get_var("SELECT ID FROM $wpdb->posts ORDER BY ID DESC LIMIT 1") + 1; $post_pingback = intval($_POST['post_pingback']); - $content = balanceTags($_POST['content']); + $content = apply_filters('content_save_pre', $_POST['content']); $content = format_to_post($content); - $excerpt = balanceTags($_POST['excerpt']); + $excerpt = apply_filters('excerpt_save_pre',$_POST['excerpt']); $excerpt = format_to_post($excerpt); $post_title = $_POST['post_title']; $post_categories = $_POST['post_category']; @@ -281,9 +281,9 @@ case 'editpost': $post_ID = $_POST['post_ID']; $post_categories = $_POST['post_category']; if (!$post_categories) $post_categories[] = 1; - $content = balanceTags($_POST['content']); + $content = apply_filters('content_save_pre', $_POST['content']); $content = format_to_post($content); - $excerpt = balanceTags($_POST['excerpt']); + $excerpt = apply_filters('excerpt_save_pre', $_POST['excerpt']); $excerpt = format_to_post($excerpt); $post_title = $_POST['post_title']; $prev_status = $_POST['prev_status']; @@ -702,7 +702,7 @@ case 'editedcomment': } else { $datemodif = ''; } - $content = balanceTags($_POST['content']); + $content = apply_filters('comment_save_pre', $_POST['content']); $content = format_to_post($content); $result = $wpdb->query(" diff --git a/wp-comments-post.php b/wp-comments-post.php index 2e0783d039..f6a2247616 100644 --- a/wp-comments-post.php +++ b/wp-comments-post.php @@ -48,8 +48,6 @@ if ( '' == $comment ) $now = current_time('mysql'); $now_gmt = current_time('mysql', 1); - -$comment = balanceTags($comment, 1); $comment = format_to_post($comment); $comment = apply_filters('post_comment_text', $comment); diff --git a/wp-includes/template-functions-comment.php b/wp-includes/template-functions-comment.php index e425b53cd6..2b6d0a4f9a 100644 --- a/wp-includes/template-functions-comment.php +++ b/wp-includes/template-functions-comment.php @@ -11,11 +11,17 @@ add_filter('comment_url', 'clean_url'); add_filter('comment_text', 'convert_chars'); add_filter('comment_text', 'make_clickable'); add_filter('comment_text', 'wpautop', 30); -add_filter('comment_text', 'balanceTags'); +add_filter('comment_text', 'balanceTags', 50); add_filter('comment_text', 'convert_smilies', 20); add_filter('comment_excerpt', 'convert_chars'); +// Places to balance tags on input +add_filter('post_comment_text', 'balanceTags', 50); +add_filter('content_save_pre', 'balanceTags', 50); +add_filter('excerpt_save_pre', 'balanceTags', 50); +add_filter('comment_save_pre', 'balanceTags', 50); + function comments_template() { global $withcomments, $post, $wpdb, $id, $comment;