WordPress.org

Make WordPress Core

Ticket #20812: 20812.diff

File 20812.diff, 2.1 KB (added by nacin, 23 months ago)
  • wp-includes/comment-template.php

     
    816816        if ( !empty($post) ) 
    817817                $post_id = $post->ID; 
    818818 
    819         if ( current_user_can('unfiltered_html') ) 
    820                 wp_nonce_field('unfiltered-html-comment_' . $post_id, '_wp_unfiltered_html_comment', false); 
     819        if ( current_user_can( 'unfiltered_html' ) ) { 
     820                wp_nonce_field( 'unfiltered-html-comment_' . $post_id, '_wp_unfiltered_html_comment_disabled', false ); 
     821                echo "<script>(function(){if(window===window.parent){document.getElementById('_wp_unfiltered_html_comment_disabled').name='_wp_unfiltered_html_comment';}})();</script>\n"; 
     822        } 
    821823} 
    822824 
    823825/** 
  • wp-includes/kses.php

     
    13631363 * @uses add_filter() See description for what functions are added to what hooks. 
    13641364 */ 
    13651365function kses_init_filters() { 
    1366         // Normal filtering. 
    1367         add_filter('pre_comment_content', 'wp_filter_kses'); 
     1366        // Normal filtering 
    13681367        add_filter('title_save_pre', 'wp_filter_kses'); 
    13691368 
     1369        // Comment filtering 
     1370        if ( current_user_can( 'unfiltered_html' ) ) 
     1371                add_filter( 'pre_comment_content', 'wp_filter_post_kses' ); 
     1372        else 
     1373                add_filter( 'pre_comment_content', 'wp_filter_kses' ); 
     1374 
    13701375        // Post filtering 
    13711376        add_filter('content_save_pre', 'wp_filter_post_kses'); 
    13721377        add_filter('excerpt_save_pre', 'wp_filter_post_kses'); 
     
    13861391 * @since 2.0.6 
    13871392 */ 
    13881393function kses_remove_filters() { 
    1389         // Normal filtering. 
    1390         remove_filter('pre_comment_content', 'wp_filter_kses'); 
     1394        // Normal filtering 
    13911395        remove_filter('title_save_pre', 'wp_filter_kses'); 
    13921396 
     1397        // Comment filtering 
     1398        remove_filter( 'pre_comment_content', 'wp_filter_post_kses' ); 
     1399        remove_filter( 'pre_comment_content', 'wp_filter_kses' ); 
     1400 
    13931401        // Post filtering 
    13941402        remove_filter('content_save_pre', 'wp_filter_post_kses'); 
    13951403        remove_filter('excerpt_save_pre', 'wp_filter_post_kses');