[wp-cvs] wordpress/wp-includes comment-functions.php, 1.17,
1.18 functions-formatting.php, 1.61, 1.62 vars.php, 1.44, 1.45
Matthew Mullenweg
saxmatt at users.sourceforge.net
Fri Jan 21 18:24:16 GMT 2005
Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16791/wp-includes
Modified Files:
comment-functions.php functions-formatting.php vars.php
Log Message:
Adding nofollow support
Index: vars.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/vars.php,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** vars.php 20 Jan 2005 04:56:24 -0000 1.44
--- vars.php 21 Jan 2005 18:24:14 -0000 1.45
***************
*** 141,144 ****
--- 141,145 ----
add_filter('pre_comment_content', 'wp_filter_kses');
+ add_filter('pre_comment_content', 'wp_rel_nofollow', 15);
add_filter('pre_comment_content', 'balanceTags', 30);
Index: comment-functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/comment-functions.php,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** comment-functions.php 21 Jan 2005 03:33:13 -0000 1.17
--- comment-functions.php 21 Jan 2005 18:24:13 -0000 1.18
***************
*** 159,163 ****
$return = $author;
else
! $return = "<a href='$url' rel='external'>$author</a>";
return apply_filters('get_comment_author_link', $return);
}
--- 159,163 ----
$return = $author;
else
! $return = "<a href='$url' rel='external nofollow'>$author</a>";
return apply_filters('get_comment_author_link', $return);
}
Index: functions-formatting.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions-formatting.php,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -d -r1.61 -r1.62
*** functions-formatting.php 6 Jan 2005 10:24:11 -0000 1.61
--- functions-formatting.php 21 Jan 2005 18:24:14 -0000 1.62
***************
*** 480,485 ****
function make_clickable($ret) {
$ret = ' ' . $ret . ' ';
! $ret = preg_replace("#([\s>])(https?)://([^\s<>{}()]+[^\s.,<>{}()])#i", "$1<a href='$2://$3'>$2://$3</a>", $ret);
! $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);
$ret = preg_replace("#(\s)([a-z0-9\-_.]+)@([^,< \n\r]+)#i", "$1<a href=\"mailto:$2@$3\">$2@$3</a>", $ret);
$ret = trim($ret);
--- 480,485 ----
function make_clickable($ret) {
$ret = ' ' . $ret . ' ';
! $ret = preg_replace("#([\s>])(https?)://([^\s<>{}()]+[^\s.,<>{}()])#i", "$1<a href='$2://$3' rel='nofollow'>$2://$3</a>", $ret);
! $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);
$ret = preg_replace("#(\s)([a-z0-9\-_.]+)@([^,< \n\r]+)#i", "$1<a href=\"mailto:$2@$3\">$2@$3</a>", $ret);
$ret = trim($ret);
***************
*** 487,490 ****
--- 487,495 ----
}
+ function wp_rel_nofollow( $text ) {
+ $text = preg_replace('|<a(.+?)>|i', '<a$1 rel="nofollow">', $text);
+ return $text;
+ }
+
function convert_smilies($text) {
global $wp_smiliessearch, $wp_smiliesreplace;
***************
*** 633,635 ****
}
! ?>
--- 638,640 ----
}
! ?>
\ No newline at end of file
More information about the cvs
mailing list