Make WordPress Core


Ignore:
Timestamp:
12/30/2015 11:19:11 PM (9 years ago)
Author:
swissspidy
Message:

Comments: Don't nofollow links within the site.

Fixes #11360.

File:
1 edited

Legend:

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

    r36100 r36125  
    23372337    $text = $matches[1];
    23382338    $atts = shortcode_parse_atts( $matches[1] );
    2339     $rel = 'nofollow';
     2339    $rel  = 'nofollow';
     2340
     2341    if ( preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'http' ) ) . ')%i', $text ) ||
     2342         preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'https' ) ) . ')%i', $text )
     2343    ) {
     2344        return "<a $text>";
     2345    }
     2346
    23402347    if ( ! empty( $atts['rel'] ) ) {
    23412348        $parts = array_map( 'trim', explode( ' ', $atts['rel'] ) );
Note: See TracChangeset for help on using the changeset viewer.