Make WordPress Core


Ignore:
Timestamp:
03/02/2018 02:41:04 PM (7 years ago)
Author:
azaozz
Message:

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

Props notnownikki, iseulde, azaozz
Fixes #43187

File:
1 edited

Legend:

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

    r42441 r42770  
    104104    add_filter( $filter, 'balanceTags', 50 );
    105105}
     106
     107// Add proper rel values for links with target.
     108foreach ( array(
     109    'title_save_pre',
     110    'content_save_pre',
     111    'excerpt_save_pre',
     112    'content_filtered_save_pre',
     113    'pre_comment_content',
     114    'pre_term_description',
     115    'pre_link_description',
     116    'pre_link_notes',
     117    'pre_user_description',
     118) as $filter ) {
     119    add_filter( $filter, 'wp_targeted_link_rel' );
     120};
    106121
    107122// Format strings for display.
Note: See TracChangeset for help on using the changeset viewer.