WordPress.org

Make WordPress Core

Ticket #7559: 7559.diff

File 7559.diff, 1.3 KB (added by slushpilejs, 10 years ago)

rescued lone less than sign in pre_term_name from strip_tags(), separated out pre_term_name filters

  • wp-includes/default-filters.php

     
    1212 * @package WordPress
    1313 */
    1414
    15 // Strip, trim, kses, special chars for string saves
    16 $filters = array('pre_term_name', 'pre_comment_author_name', 'pre_link_name', 'pre_link_target',
     15// Strip, trim, kses, special chars for string saves, converting lone less than sign to < (rescuing from strip_tags)
     16$filters = array('pre_term_name');
     17foreach ( $filters as $filter ) {
     18        add_filter($filter, 'trim');
     19        add_filter($filter, 'wp_pre_kses_less_than');
     20        add_filter($filter, 'strip_tags');
     21        add_filter($filter, 'wp_filter_kses');
     22        add_filter($filter, 'wp_specialchars', 30);
     23}
     24
     25// Strip, trim, kses, special chars for string saves, without converting less than sign (where invalid or undesirable)
     26$filters = array('pre_comment_author_name', 'pre_link_name', 'pre_link_target',
    1727        'pre_link_rel', 'pre_user_display_name', 'pre_user_first_name', 'pre_user_last_name',
    1828        'pre_user_nickname');
    1929foreach ( $filters as $filter ) {
     30        add_filter($filter, 'trim');
    2031        add_filter($filter, 'strip_tags');
    21         add_filter($filter, 'trim');
    2232        add_filter($filter, 'wp_filter_kses');
    2333        add_filter($filter, 'wp_specialchars', 30);
    2434}