mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-27 10:08:27 +00:00
Sync balanceTags() and force_balance_tags() to trunk. fixes #2714
git-svn-id: http://svn.automattic.com/wordpress/branches/2.0@4663 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
70902a4e04
commit
bf83dbd55f
@ -403,6 +403,7 @@ function funky_javascript_fix($text) {
|
||||
Balances Tags of string using a modified stack.
|
||||
|
||||
@param text Text to be balanced
|
||||
@param force Forces balancing, ignoring the value of the option
|
||||
@return Returns balanced text
|
||||
@author Leonard Lin (leonard@acm.org)
|
||||
@version v1.1
|
||||
@ -411,14 +412,14 @@ function funky_javascript_fix($text) {
|
||||
@notes
|
||||
@changelog
|
||||
--- Modified by Scott Reilly (coffee2code) 02 Aug 2004
|
||||
1.2 ***TODO*** Make better - change loop condition to $text
|
||||
1.1 Fixed handling of append/stack pop order of end text
|
||||
Added Cleaning Hooks
|
||||
1.0 First Version
|
||||
1.2 ***TODO*** Make better - change loop condition to $text
|
||||
1.1 Fixed handling of append/stack pop order of end text
|
||||
Added Cleaning Hooks
|
||||
1.0 First Version
|
||||
*/
|
||||
function balanceTags($text, $is_comment = 0) {
|
||||
function balanceTags($text, $force = false) {
|
||||
|
||||
if ( get_option('use_balanceTags') == 0)
|
||||
if ( !$force && get_option('use_balanceTags') == 0 )
|
||||
return $text;
|
||||
|
||||
$tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = '';
|
||||
@ -518,7 +519,7 @@ function balanceTags($text, $is_comment = 0) {
|
||||
}
|
||||
|
||||
function force_balance_tags($text) {
|
||||
return balanceTags($text, 0, true);
|
||||
return balanceTags($text, true);
|
||||
}
|
||||
|
||||
function format_to_edit($content, $richedit = false) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user