Ticket #11360: 11360.diff

File 11360.diff, 576 bytes (added by caesarsgrunt, 3 years ago)
Line 
1Index: wp-includes/formatting.php
2===================================================================
3--- wp-includes/formatting.php  (revision 12345)
4+++ wp-includes/formatting.php  (working copy)
5@@ -1393,7 +1393,10 @@
6 function wp_rel_nofollow_callback( $matches ) {
7        $text = $matches[1];
8        $text = str_replace(array(' rel="nofollow"', " rel='nofollow'"), '', $text);
9-       return "<a $text rel=\"nofollow\">";
10+       if (preg_match('%href=["\']('.get_option('siteurl').')?(\.){0,2}(/|#|["\'])%i', $text))
11+               return "<a $text>";
12+       else
13+               return "<a $text rel=\"nofollow\">";
14 }
15 
16