WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/16/2018 04:12:21 AM (16 months ago)
Author:
peterwilsoncc
Message:

Formatting: Add pre-save content filter to make target=_blank always secure.

Props notnownikki, iseulde, azaozz.
Merges [42770] to the 5.0 branch.
Fixes #43187.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-includes/default-filters.php

    r43729 r43732  
    118118    add_filter( $filter, 'balanceTags', 50 );
    119119}
     120
     121// Add proper rel values for links with target.
     122foreach ( array(
     123    'title_save_pre',
     124    'content_save_pre',
     125    'excerpt_save_pre',
     126    'content_filtered_save_pre',
     127    'pre_comment_content',
     128    'pre_term_description',
     129    'pre_link_description',
     130    'pre_link_notes',
     131    'pre_user_description',
     132) as $filter ) {
     133    add_filter( $filter, 'wp_targeted_link_rel' );
     134};
    120135
    121136// Format strings for display.
Note: See TracChangeset for help on using the changeset viewer.