Make WordPress Core

Ticket #1087: nofollow.diff

File nofollow.diff, 2.8 KB (added by kim, 21 years ago)
  • wp-includes/comment-functions.php

    RCS file: /cvsroot/cafelog/wordpress/wp-includes/comment-functions.php,v
    retrieving revision 1.29
    diff -u -r1.29 comment-functions.php
     
    170170        if ( empty( $url ) )
    171171                $return = $author;
    172172        else
    173                 $return = "<a href='$url' rel='external nofollow'>$author</a>";
     173                $return = "<a href='$url' rel='external'>$author</a>";
    174174        return apply_filters('get_comment_author_link', $return);
    175175}
    176176
  • wp-includes/default-filters.php

    RCS file: /cvsroot/cafelog/wordpress/wp-includes/default-filters.php,v
    retrieving revision 1.1
    diff -u -r1.1 default-filters.php
     
    3435add_filter('pre_comment_author_email', 'wp_filter_kses');
    3536add_filter('pre_comment_author_url', 'wp_filter_kses');
    3637
     38add_filter('get_comment_author_link', 'wp_rel_nofollow', 15);
     39
    3740// Default filters for these functions
    3841add_filter('comment_author', 'wptexturize');
    3942add_filter('comment_author', 'convert_chars');
     
    4548
    4649add_filter('comment_text', 'convert_chars');
    4750add_filter('comment_text', 'make_clickable');
     51add_filter('comment_text', 'wp_rel_nofollow', 15);
    4852add_filter('comment_text', 'wpautop', 30);
    4953add_filter('comment_text', 'convert_smilies', 20);
    5054
  • wp-includes/functions-formatting.php

    RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions-formatting.php,v
    retrieving revision 1.67
    diff -u -r1.67 functions-formatting.php
     
    481481
    482482function make_clickable($ret) {
    483483        $ret = ' ' . $ret . ' ';
    484         $ret = preg_replace("#([\s>])(https?)://([^\s<>{}()]+[^\s.,<>{}()])#i", "$1<a href='$2://$3' rel='nofollow'>$2://$3</a>", $ret);
    485         $ret = preg_replace("#(\s)www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^ <>{}()\n\r]*[^., <>{}()\n\r]?)?)#i", "$1<a href='http://www.$2.$3$4' rel='nofollow'>www.$2.$3$4</a>", $ret);
     484        $ret = preg_replace("#([\s>])(https?)://([^\s<>{}()]+[^\s.,<>{}()])#i", "$1<a href='$2://$3'>$2://$3</a>", $ret);
     485        $ret = preg_replace("#(\s)www\.([a-z0-9\-]+)\.([a-z0-9\-.\~]+)((?:/[^ <>{}()\n\r]*[^., <>{}()\n\r]?)?)#i", "$1<a href='http://www.$2.$3$4'>www.$2.$3$4</a>", $ret);
    486486        $ret = preg_replace("#(\s)([a-z0-9\-_.]+)@([^,< \n\r]+)#i", "$1<a href=\"mailto:$2@$3\">$2@$3</a>", $ret);
    487487        $ret = trim($ret);
    488488        return $ret;