WordPress.org

Make WordPress Core

Ticket #7559: wp-inc.default-filters.diff

File wp-inc.default-filters.diff, 1.0 KB (added by MattyRob, 9 years ago)
  • default-filters.php

     
    1313 */
    1414
    1515// Strip, trim, kses, special chars for string saves
    16 $filters = array('pre_term_name', 'pre_comment_author_name', 'pre_link_name', 'pre_link_target',
     16$filters = array('pre_comment_author_name', 'pre_link_target',
    1717        'pre_link_rel', 'pre_user_display_name', 'pre_user_first_name', 'pre_user_last_name',
    1818        'pre_user_nickname');
    1919foreach ( $filters as $filter ) {
     
    2323        add_filter($filter, 'wp_specialchars', 30);
    2424}
    2525
     26$filters = array('pre_term_name', 'pre_link_name');
     27foreach ( $filters as $filter ) {
     28        add_filter($filter, 'wp_specialchars', 1);
     29        add_filter($filter, 'strip_tags');
     30        add_filter($filter, 'trim');
     31        add_filter($filter, 'wp_filter_kses');
     32}
     33
    2634// Kses only for textarea saves
    2735$filters = array('pre_term_description', 'pre_link_description', 'pre_link_notes', 'pre_user_description');
    2836foreach ( $filters as $filter ) {