Changeset 4663
- Timestamp:
- 12/23/2006 06:33:24 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/wp-includes/functions-formatting.php
r4661 r4663 400 400 /* 401 401 balanceTags 402 402 403 403 Balances Tags of string using a modified stack. 404 404 405 405 @param text Text to be balanced 406 @param force Forces balancing, ignoring the value of the option 406 407 @return Returns balanced text 407 408 @author Leonard Lin (leonard@acm.org) … … 409 410 @date November 4, 2001 410 411 @license GPL v2.0 411 @notes 412 @changelog 412 @notes 413 @changelog 413 414 --- Modified by Scott Reilly (coffee2code) 02 Aug 2004 414 415 416 417 415 1.2 ***TODO*** Make better - change loop condition to $text 416 1.1 Fixed handling of append/stack pop order of end text 417 Added Cleaning Hooks 418 1.0 First Version 418 419 */ 419 function balanceTags($text, $ is_comment = 0) {420 421 if ( get_option('use_balanceTags') == 0)420 function balanceTags($text, $force = false) { 421 422 if ( !$force && get_option('use_balanceTags') == 0 ) 422 423 return $text; 423 424 … … 441 442 $tag = strtolower(substr($regex[1],1)); 442 443 // if too many closing tags 443 if($stacksize <= 0) { 444 if($stacksize <= 0) { 444 445 $tag = ''; 445 446 //or close to be safe $tag = '/' . $tag; … … 498 499 $newtext .= substr($text,0,$i) . $tag; 499 500 $text = substr($text,$i+$l); 500 } 501 } 501 502 502 503 // Clear Tag Queue … … 519 520 520 521 function force_balance_tags($text) { 521 return balanceTags($text, 0,true);522 return balanceTags($text, true); 522 523 } 523 524
Note: See TracChangeset
for help on using the changeset viewer.