WordPress.org

Make WordPress Core

Ticket #5796: escape.diff

File escape.diff, 1.0 KB (added by andy, 10 years ago)
  • general-template.php

     
    932932
    933933                if ( 'tinymce' == $wp_default_editor )
    934934                        add_filter('the_editor_content', 'wp_richedit_pre');
     935                else if ( 'html' == $wp_default_editor )
     936                        add_filter('the_editor_content', 'wp_htmledit_pre');
    935937
    936938                //      The following line moves the border so that the active button "attaches" to the toolbar. Only IE needs it.
    937939        ?>
  • formatting.php

     
    11111111        return apply_filters('richedit_pre', $output);
    11121112}
    11131113
     1114function wp_htmledit_pre($output) {
     1115        if ( !empty($output) )
     1116                $output = htmlspecialchars($output, ENT_NOQUOTES); // convert only < > &
     1117
     1118        return apply_filters('htmledit_pre', $output);
     1119}
     1120
    11141121function clean_url( $url, $protocols = null, $context = 'display' ) {
    11151122        $original_url = $url;
    11161123