WordPress.org

Make WordPress Core

Ticket #4626: 4626.diff

File 4626.diff, 2.9 KB (added by mdawaffe, 11 years ago)
  • wp-includes/default-filters.php

     
    2727add_filter('pre_comment_author_url', 'clean_url');
    2828
    2929add_filter('pre_comment_content', 'wp_rel_nofollow', 15);
    30 add_filter('pre_comment_content', 'balanceTags', 30);
     30add_filter('pre_comment_content', 'wp_balance_tags', 30);
    3131
    3232add_filter('pre_comment_author_name', 'wp_filter_kses');
    3333add_filter('pre_comment_author_email', 'wp_filter_kses');
     
    4848
    4949add_filter('comment_text', 'convert_chars');
    5050add_filter('comment_text', 'make_clickable', 9);
    51 add_filter('comment_text', 'force_balance_tags', 25);
     51add_filter('comment_text', 'balanceTags', 25);
    5252add_filter('comment_text', 'wpautop', 30);
    5353add_filter('comment_text', 'convert_smilies', 20);
    5454
     
    119119add_filter('pre_user_email', 'sanitize_email');
    120120
    121121// Places to balance tags on input
    122 add_filter('content_save_pre', 'balanceTags', 50);
    123 add_filter('excerpt_save_pre', 'balanceTags', 50);
    124 add_filter('comment_save_pre', 'balanceTags', 50);
     122add_filter('content_save_pre', 'wp_balance_tags', 50);
     123add_filter('excerpt_save_pre', 'wp_balance_tags', 50);
     124add_filter('comment_save_pre', 'wp_balance_tags', 50);
    125125
    126126// Misc. title, content, and excerpt filters
    127127add_filter('the_title', 'convert_chars');
     
    190190add_action('save_post', '_save_post_hook', 5, 2);
    191191add_action('transition_post_status', '_transition_post_status', 5, 3);
    192192
    193 ?>
    194  No newline at end of file
     193?>
  • wp-includes/formatting.php

     
    433433             Added Cleaning Hooks
    434434        1.0  First Version
    435435*/
    436 function balanceTags($text, $force = false) {
    437 
    438         if ( !$force && get_option('use_balanceTags') == 0 )
    439                 return $text;
    440 
     436function balanceTags( $text ) {
    441437        $tagstack = array(); $stacksize = 0; $tagqueue = ''; $newtext = '';
    442438        $single_tags = array('br', 'hr', 'img', 'input'); //Known single-entity/self-closing tags
    443439        $nestable_tags = array('blockquote', 'div', 'span'); //Tags that can be immediately nested within themselves
     
    536532        return $newtext;
    537533}
    538534
    539 function force_balance_tags($text) {
    540         return balanceTags($text, true);
     535function wp_balance_tags( $text ) {
     536        if ( 0 == get_option( 'use_balanceTags' ) )
     537                return $text;
     538        return balanceTags( $text );
    541539}
    542540
    543541function format_to_edit($content, $richedit = false) {
  • wp-includes/deprecated.php

     
    484484        the_permalink();
    485485}
    486486
    487 ?>
    488  No newline at end of file
     487function force_balance_tags( $text ) {
     488        return balanceTags( $text );
     489}
     490
     491?>