WordPress.org

Make WordPress Core

Ticket #2348: div-balance.diff

File div-balance.diff, 1.7 KB (added by skeltoac, 12 years ago)
  • wp-includes/template-functions-post.php

     
    7979
    8080        $content = $pages[$page-1];
    8181        $content = explode('<!--more-->', $content, 2);
    82         if ( (preg_match('/<!--noteaser-->/', $post->post_content) && ((!$multipage) || ($page==1))) )
     82        if ( (false !== strpos($post->post_content, '<!--noteaser-->') && ((!$multipage) || ($page==1))) )
    8383                $stripteaser = 1;
    8484        $teaser = $content[0];
    8585        if ( ($more) && ($stripteaser) )
     
    8989                if ( $more )
    9090                        $output .= '<a id="more-'.$id.'"></a>'.$content[1];
    9191                else
    92                         $output .= ' <a href="'. get_permalink() . "#more-$id\">$more_link_text</a>";
     92                        $output = balanceTags($output . ' <a href="'. get_permalink() . "#more-$id\">$more_link_text</a>");
    9393        }
    9494        if ( $preview ) // preview fix for javascript bug with foreign languages
    9595                $output =       preg_replace('/\%u([0-9A-F]{4,4})/e',   "'&#'.base_convert('\\1',16,10).';'", $output);
  • wp-includes/functions-formatting.php

     
    400400                  Added Cleaning Hooks
    401401             1.0  First Version
    402402*/
    403 function balanceTags($text, $is_comment = 0) {
     403function balanceTags($text, $is_comment = 0, $force = false) {
    404404       
    405         if ( get_option('use_balanceTags') == 0)
     405        if ( !$force && get_option('use_balanceTags') == 0 )
    406406                return $text;
    407407
    408408        $tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = '';