WordPress.org

Make WordPress Core

Ticket #11360: 11360.diff

File 11360.diff, 576 bytes (added by caesarsgrunt, 5 years ago)
  • wp-includes/formatting.php

     
    13931393function wp_rel_nofollow_callback( $matches ) { 
    13941394        $text = $matches[1]; 
    13951395        $text = str_replace(array(' rel="nofollow"', " rel='nofollow'"), '', $text); 
    1396         return "<a $text rel=\"nofollow\">"; 
     1396        if (preg_match('%href=["\']('.get_option('siteurl').')?(\.){0,2}(/|#|["\'])%i', $text)) 
     1397                return "<a $text>"; 
     1398        else 
     1399                return "<a $text rel=\"nofollow\">"; 
    13971400} 
    13981401 
    13991402