Make WordPress Core


Ignore:
Timestamp:
07/16/2007 07:23:41 PM (17 years ago)
Author:
ryan
Message:

Make balanceTags() option independent. Props mdawaffe. fixes #4626

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r5783 r5805  
    414414}
    415415
     416function balanceTags( $text, $force = false ) {
     417    if ( !$force && get_option('use_balanceTags') == 0 )
     418        return $text;
     419    return force_balance_tags( $text );
     420}
     421
    416422/*
    417  balanceTags
     423 force_balance_tags
    418424
    419425 Balances Tags of string using a modified stack.
     
    434440    1.0  First Version
    435441*/
    436 function balanceTags($text, $force = false) {
    437 
    438     if ( !$force && get_option('use_balanceTags') == 0 )
    439         return $text;
    440 
     442function force_balance_tags( $text ) {
    441443    $tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = '';
    442444    $single_tags = array('br', 'hr', 'img', 'input'); //Known single-entity/self-closing tags
     
    535537
    536538    return $newtext;
    537 }
    538 
    539 function force_balance_tags($text) {
    540     return balanceTags($text, true);
    541539}
    542540
Note: See TracChangeset for help on using the changeset viewer.