Make WordPress Core

Changeset 6767


Ignore:
Timestamp:
02/09/2008 07:29:36 AM (17 years ago)
Author:
ryan
Message:

htmlspecialchars when loading content into html editor. Props DD32 and andy. fixes #5796

Location:
trunk/wp-includes
Files:
2 edited

Legend:

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

    r6726 r6767  
    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;
  • trunk/wp-includes/general-template.php

    r6746 r6767  
    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.
Note: See TracChangeset for help on using the changeset viewer.