From 1c5c2aee5c9fdb9c1d7f89649bf7a96eb36a871e Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 16 Jul 2007 19:23:41 +0000 Subject: [PATCH] Make balanceTags() option independent. Props mdawaffe. fixes #4626 git-svn-id: https://develop.svn.wordpress.org/trunk@5805 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/formatting.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index cf72def271..105b2d50a5 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -413,8 +413,14 @@ function funky_javascript_fix($text) { return $text; } +function balanceTags( $text, $force = false ) { + if ( !$force && get_option('use_balanceTags') == 0 ) + return $text; + return force_balance_tags( $text ); +} + /* - balanceTags + force_balance_tags Balances Tags of string using a modified stack. @@ -433,11 +439,7 @@ function funky_javascript_fix($text) { Added Cleaning Hooks 1.0 First Version */ -function balanceTags($text, $force = false) { - - if ( !$force && get_option('use_balanceTags') == 0 ) - return $text; - +function force_balance_tags( $text ) { $tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = ''; $single_tags = array('br', 'hr', 'img', 'input'); //Known single-entity/self-closing tags $nestable_tags = array('blockquote', 'div', 'span'); //Tags that can be immediately nested within themselves @@ -536,10 +538,6 @@ function balanceTags($text, $force = false) { return $newtext; } -function force_balance_tags($text) { - return balanceTags($text, true); -} - function format_to_edit($content, $richedit = false) { $content = apply_filters('format_to_edit', $content); if (! $richedit )